This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
using_awk_on_csv_files [2015/08/02 21:47] Joel Dare |
using_awk_on_csv_files [2023/05/22 12:50] Joel Dare |
||
---|---|---|---|
Line 10: | Line 10: | ||
awk -F "\"*,\"*" '{print $3}' file.csv | awk -F "\"*,\"*" '{print $3}' file.csv | ||
+ | |||
+ | <box 50% round orange|Sweet Awk Magic>[[https://course.joeldare.com/awk/|Join my 90-minute workshop and learn my tips and tricks to quickly process CSV files with Awk.]]</box> | ||
As another example, take the following pipe delimited format: | As another example, take the following pipe delimited format: | ||
Line 31: | Line 33: | ||
awk -F "\"*,\"*" '{print $3 "|" $1}' file.csv | awk -F "\"*,\"*" '{print $3 "|" $1}' file.csv | ||
- | <html> | + | ====== Unmatched Error ====== |
- | <a id="csv_link" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SNV2TUB7Q3PKN"> | + | |
- | <img id="csv_submission" src="https://dl.dropboxusercontent.com/u/58852318/ads/csv_submission/csv_subscription_a.png"> | + | If you get an error about an unmatched comma, you are probably trying to run this in a csh shell instead of a bash shell. These shells behave a little differently. Here's the error you'll get. |
- | </a> | + | |
- | </html> | + | 'Unmatched ".' |
+ | |||
+ | One solution is to run this command from bash. To switch to a bash shell, just run the /bash/ command to switch to a bash shell. | ||
+ | |||
+ | bash | ||
+ | |||
+ | Special thanks to Marina for reporting this error. | ||
====== In an Awk File ====== | ====== In an Awk File ====== |