Guest User

awk exclude fields in csv

a guest
Sep 12th, 2011
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Awk 0.66 KB | None | 0 0
  1. gawk -v f=6 -v t=239 '{ for (i=1; i<=260;i++) if( i>=f && i<=t) continue; else printf("%s%s", $i,(i!=0) ? OFS : ORS) }' tx000452010.txt
  2.  
  3.  
  4.  
  5. sample output:
  6.  
  7. SF1ST,TX,000,45,0000558,0,0,0,0,5,2,3,0,67,13,15,39,3.05,2.55,3.55,2.33,2.33,0.00,2.00,2.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,2.50,2.50,0.00,0.00,0.00,0.00,2.50,2.50,0.00,3.05,2.55,3.55,22,11,2,4,2,3,0,0,0,11,0,2,3,4,2,0,0,3,3,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,22,11,2,4,2,3,0,0,0,11,0,2,3,4,2,0,0,22,11,0,2,3,1
Advertisement
Add Comment
Please, Sign In to add comment