grashoper has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to verify datafile contains an entire record before taking the record and making it comma delimited so it can be imported into a db, I am still stuck on this one piece as I keep getting can't find string terminator on my command line when I try it. input.txt file is the file I want to parse. lane command line switches l is for label,n for loop etc. e for eval i think, this was provided by codeblue and I don't totally understand it which is a problem. stamp is supposed to be the record delimiter but I am not sure how to define it as its a date time value format is like this 6/15/2008 5:39:10 PM
perl -F -lane '@F %2 and push @D,{q{Stamp},@F} or $D[-1]={% {$D[-1]},@ +F}}{$,=",";print @{$_}{qw(Stamp Login searchload)}for @D' input.txt
in the example I was provided were 2 variables defined as hashes wondering if I need those to populate hash so it understands timestamp will try with those included and postback results later today, interesting it appears to be searching the entire file for the lines containing the hash values then terminates when it cannot find it.

Replies are listed 'Best First'.
Re: command line error question
by ikegami (Patriarch) on Jul 31, 2008 at 21:10 UTC
    The Windows shell uses double-quotes for arguments, not single-quotes. Perl is seeing
    perl -F -lane "'@F" ...some arguments...
      Archbishop? more like a deity, thank you.. now its not able to open my file..but at least I am closer.
Re: command line error question
by Anonymous Monk on Jul 31, 2008 at 23:26 UTC
    forget the commandline, files are cheap perl -MO=Deparse ...