linux - unzip but extract only certain fileds using unix -


i have large text file 5-6 gigs 61,213,301 lines. in comma delimited state.

field1,field2,,,field5,,,field8...  

since don't want extract whole thing csv (more can't). trying extract lines such field2 = abc.

i extracting new file

gzip -dc 20130516.ticks.gz | cut -d, -f2,17,18,20-36  > ~/test/20130516.file 

is there way extract lines field2=abc or extract 20130516.file field2=abc ?

using awk:

gzip -dc 20130516.ticks.gz | awk -f, '$2 == "abc"' > output.csv 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

java - Using an Integer ArrayList in Android -