![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| need to extract field of characters in a line | jansat | Shell Programming and Scripting | 3 | 05-22-2008 10:44 AM |
| How to grab the value of field before the line reached | ahjiefreak | Shell Programming and Scripting | 3 | 03-28-2008 05:59 AM |
| removing last field of the line | adddy | UNIX for Dummies Questions & Answers | 4 | 12-11-2006 11:35 PM |
| Replacing the last field of a line. | Darek | Shell Programming and Scripting | 3 | 08-19-2005 12:45 PM |
| Append a field to the end of each line of a file based on searching another file. | ultimate | Shell Programming and Scripting | 2 | 03-29-2005 11:21 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
AWK line by line instead of field by field?
I've been using a lot of awk lately for csv files. But I've been using awk for csv files that contain 32 fields per line. For the first time, I've been given a csv file that contains one field per line (13 fields in each csv file). I need to check that a specific field, or line contains a string. There are no commas or delimiters at the end of each line. Here's how I would calculate it if all fields were in one line. Code:
trade_count=`awk -F, '$7 ~ /:22A:NEWT/ { trade_count++ } END { print trade_count }' myCSV.csv`
How would I convert that to a csv file that has one field per line? I found this in another post, how do I apply it to what I want to accomplish? awk '{ if(NR == 7) print}' <filename> |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|