in reply to parsing a space-separated filename in a line with fields separated by spaces

Would you mind using a regex?
while (<>) { if (/^(\w{3} \w{3} [ :\d]{16}) (\d+) ([.\d]+) (\d+) (.+) ([a]) ([_ +]) ([o]) ([r]) (\w+) (\w+) (\d) (\S) ([c])$/) { print "$1 $2 $3 $4 '$5' $6 $7 $8 $9 $10 $11 $12 $13 $14\n"; } }
puts nice single quotes around the name and you can access every field as well. You might even assign it to a list of variables.
  • Comment on Re: parsing a space-separated filename in a line with fields separated by spaces
  • Download Code