using sed to remove line in a comma-delimited file
Greetings all,
I have a script that output all my data in to a comma-delimited file separated by ";" Current Output: Quote:
New Output Quote:
Thanks in Advance, SeeFor |
I guess you would call this a semi-colon delimited file!
I think awk would be a better tool because the data is organized in records, and the NA needs to match in just the second field. Code:
awk -F\; '$2 != "NA" { print }' sample |
This could possibly match an NA not in the second field, but its quick.
Code:
| sed '/^*;NA;*/d' |
Thank you very much jschiwal and crabboy.:D:D:D
I couldn't use SED cause the rest of the data have NA in different fields. Code:
awk -F\; '$2 != "NA" { print }' Thanks again, SeeFor |
You could use a matching expression such as :sed '/^[^;][^;]*;NA;/d' file. But it would be uuugly.
Awk is the program to use for text files that are organized in fields. That is what it was written for. |
All times are GMT -5. The time now is 11:59 AM. |