0

I have 170 files in .t2 format that I'm trying to extract some variables. Here is the command I used.

awk '{x[$1 "\t" $2]+=$8;}END{for(i in x)print x[i];}' *.t2>volume.txt

The problem is it doesn't write anything to output file. When I tried one file it works. But I cannot do it one by one for 170 files.

halfer
  • 19,824
  • 17
  • 99
  • 186
mtm
  • 1
  • The only way that would not produce any output is if it didn't get any input or if the directory you're running it from is not writable. Does `ls -l *.t2` executed in the same directory show you a list of non-empty files? Does the awk command when run without `>volume.txt` produce any output? – Ed Morton Nov 12 '16 at 19:01
  • I tried your code with two sample files and it worked fine for me...can you try with just 2 files and let me know how the 2 files looks like? – Jay Rajput Nov 12 '16 at 19:57

0 Answers0