anadem has asked for the wisdom of the Perl Monks concerning the following question:
The script splits two filenames out of a line of text; now it needs to handle long filenames within quotes, where a space was previously the delimiter.
Many thanks
Alan
$TheLine = "REFERENCE z:/bin/JAnalyzer/fred.lst package/fred.lst"; $TheLine =~ /(\S*)\s+(\S*)\s+(\S*)\s*/; print "1 is $1 and 2 is $2 and 3 is $3\n"; $TheLine = 'REFERENCE "z:/bin/JAnalyzer/Justice Analyzer Users Guide.p +df" "package/Justice Analyzer Users Guide.pdf"'; $TheLine =~ /(\S*)\s+(\S*)\s+(\S*)\s*/; print "1 is $1 and 2 is $2 and 3 is $3\n"; #hmmm
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: newbie parsing question
by lidden (Curate) on Aug 28, 2004 at 17:12 UTC | |
|
Re: newbie parsing question
by wfsp (Abbot) on Aug 28, 2004 at 17:08 UTC | |
|
Re: newbie parsing question
by bobf (Monsignor) on Aug 28, 2004 at 19:38 UTC | |
|
Re: newbie parsing question
by CountZero (Bishop) on Aug 28, 2004 at 19:52 UTC | |
|
Re: newbie parsing question - thanks all!
by anadem (Scribe) on Aug 29, 2004 at 01:29 UTC |