I have .csv files with the following structure:
cat,dog,mouse,pig,bird,cow,...
21,34,54,566,78,1,...
23,10,12,569,56,4,...
32,20,13,123,56,3,...
34,30,44,322,66,2,...
I want to filter the column related to the mouse, for instance:
54
12
13
44
How do I do it? Please keep in mind that I do not know in which column the mouse is found (my files are quite large, there are several files to filter, and the positions of the columns vary).
If I knew the exact position, I could use, for instance:
cat $file | awk '{printf("%s\n", $3);}' > filtered_file
What if I do not know the mouse is in column 3?
I really appreciate any help.