I know this is a FAQ but I've already read multiple pages about this and I can't get it to work. I'm using the grep
command to locate a range of values from three different text files.
Command line:
grep -o "201[1-4].[0-9][ -9]" file1.txt file2.txt file3.txt
Output:
file1.txt:2012.69
file1.txt:2013.44
file2.txt:2013.17
file2.txt:2012.6
file2.txt:2013.75
file2.txt:2013.08
file3.txt:2013.54
file3.txt:2013.9
I want the output to have the names of the three files as the first row (header) and then all of the values found to be in each column. I think the problem is that I am unable to predict how many rows I would need.