I thought that woulda done it too (didn't try the \cV, but still the same
result - not working :().
I've expanded the s///'s:
foreach ( @lines ) {
s/\cV//gs;
s/\cv//gs;
s/\\v//gs; # just for giggles ;)
Any other ideas?
Thanks!
Jason
If memory serves me right, on Friday 25 January 2002 14:50,
[EMAIL PROTECTED] wrote:
> I didn't look it up in a table, but it should be a vertical tab. This
> explains why the printed output has so much space (in you original email)
> between `"OTHER` and the closing `"`. I am guessing that something like
> s/\cV// or s/\cv// should do the trick.
>
> -----Original Message-----
> From: Jason Purdy [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 25, 2002 2:50 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: Text::CSV problem
>
>
>
> That's a cool tip - thanks! Now when looking at the file, I see this:
>
> $ od -c oldfile3.csv |more
> ...
> 0000100 O N E L B R A I D Z E N 1 9
> 0000120 6 1 \v 7 0 7 O F F I C E " , "
> ...
>
> What the heck is a "\v"? When I tried to s/[\n\r\v]//gs; on the line, I
> get
>
> this error message:
>
> Unrecognized escape \v passed through at ./part2.pl line 21.
>
> Thanks!
>
> Jason
>
> If memory serves me right, on Friday 25 January 2002 14:26,
>
> [EMAIL PROTECTED] wrote:
> > you can use the Unix command `od -c <filename>`, which will give you an
> > octal dump in character mode of the file. This will tell you what
> > characters are where in the file.
> >
> > -----Original Message-----
> > From: Jason Purdy [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, January 25, 2002 2:25 PM
> > To: [EMAIL PROTECTED]
> > Subject: Text::CSV problem
> >
> >
> >
> > I have this CSV file given to me to grab fields and compare/update
> > against a
> >
> > db following some rules. I'm having problems parsing the CSV file,
>
> though,
>
> > b/c of some certain characters.
> >
> > I don't know what the characters are (newlines, \r's, etc [or some
> > combination of the above]) and I tried s//'ing them out to no avail. In
> > StarOffice, the characters appear as a "box". When Text::CSV (and I
> > upgraded
> > to Text::CSV_XS) spits out the error, it appears that there are newlines
>
> in
>
> > there:
> >
> > There was an error parsing oldfile.csv: 16NNNN,"John","Smith",,"OTHER
> >
> >
> >
> > ","McDonald's CORE Lab","123 Main St.",...
> >
> > Thanks in advance for any of your help! Is there any way to identify
> > what those characters are?
> >
> > Jason
> >
> > Here's some of my code:
> >
> > open ( FILE, shift );
> > @lines = <FILE>;
> > close ( FILE );
> >
> > $csv = Text::CSV_XS->new();
> >
> > foreach ( @lines ) {
> > chomp $_;
> > s/[\r\n]//g;
> > if ( $csv->parse( $_ ) ) {
> > ...
> > } else {
> > print "There was an error..." . $csv->error_input . "\n";
> > }
> > }
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]