[wplug] awk help
chris.romano at verizon.net
chris.romano at verizon.net
Fri Aug 27 16:23:16 EDT 2004
I am having some issues with parsing a file using awk. I am not sure if awk is the best tool, but I do not know perl at all. I have a comma delimited file that has a few fields quoted. In those quoted fields there are commas. So when awk process those fields it thinks that they are seperate and not one string. i.e.
<file>
some,text,"is, in",here
</file>
awk spits out:
some
text
"is
in"
here
I want it to be
some
text
is, in
here
my awk command is:
`cat $1 | awk 'BEGIN{FS=","}{print $1","$3",\""$5"\",\""$6"\","$7","$8","$9","$46","$49}' > output.trans`
I haven't found an answer from google. I saw a few people having the same problem. Most just us another language or each field is quote. In that case you can do something like {FS="\",\""}
Thanks,
Chris
More information about the wplug
mailing list