in reply to Spreadsheet::ParseExcel format help

Depends :) read perlintro#Regular expressions , especially the Simple substitution section

And use xls2tsv, http://www.cpan.org/authors/id/A/AN/ANDALE/xls2csv-1.7.pl, http://search.cpan.org/dist/xls2csv/script/xls2csv, ...

  • Comment on Re: Spreadsheet::ParseExcel format help

Replies are listed 'Best First'.
Re^2: Spreadsheet::ParseExcel format help
by cyates (Novice) on Jul 17, 2013 at 04:43 UTC

    Simplest answers are the best =] working with CSV values would be good, my problem was the annoying single quotes ' ' and this little code took care of it for me:

    #!/usr/bin/perl use strict; use warnings; my $sometext = 'somefile.txt'; open(SOME, $sometext); while(<SOME>) { chomp; $a = $_; $a =~ s/'//g; print $a; }
      Please don't use $a or $b as variable names -- NOT EVEN IN EXAMPLES; they have specialized behaviors for use when sorting... and they don't provide any indication of their content. Some short (1 letter) possibilities: $s (for "string"); $l for line; etc. etc.

      P.S: syntacticly trivial, but annoying: You changed the character you wanted removed from a comma in your OP to a single quote in your 'simplest answer.' Perhaps one was a typo, and in this thread, probably just set off my pre-coffee compulsiveness/ill-humor/whatever... but like $a, it sets a bad example for future readers.

      If I've misconstrued your question or the logic needed to answer it, I offer my apologies to all those electrons which were inconvenienced by the creation of this post.