in reply to Re^3: parsing text files continued
in thread parsing text files continued

I see you ran this from the command line didn't you, I tried as a seperate script initially I just tried typing it all in now I am down to one error unable to find string terminator but I am not sure where the problem is, I am really impressed with your example though, I wish I had as deep an understanding and command of the language as you possess. :) my error is can't find string terminator "'" anywhere before eof at -e line 1 Doh single versus double quotes.. ok now it does run but all it outputs is 6 followed by 9 comma's then 7 followed by 9 comma's I don't understand why its not showing all of it.

Replies are listed 'Best First'.
Re^5: parsing text files continued
by AltBlue (Chaplain) on Aug 01, 2008 at 01:57 UTC

    Ok, I guess you are in a Microsoft environment. Let's test using Strawberry Perl 5.10.0.1 under Microsoft Windows XP SP3:

    C:\> perl -F, -lane "@F % 2 and push @D, {q{Stamp},@F} or $D[-1] = { % +{$D[-1] }, @F } }{ $,=q{,}; print @{$_}{qw(Stamp Login SearchResults +SearchLoad SearchCount Logout)} for @D" input.txt 1/3/2007 12:20:01 AM,12.588309,7.418672,9.432586,20:0.196329,0.823402 1/3/2007 12:49:22 AM,10.958312,,,41:0.483233,

    Seems to work as expected, so I think you made some typo when trying to comply with Gate's rules.