It can be done using the below command.
awk -F "," ' $2 >= 577 ' filename.csv > create_files
You can put the entire contents of the above content into a new file (I have named the new file as create_files
) and now you can create new files from this file.
After executing the above command, since, you have not mentioned any filename convention, I have assumed the first column can act as the file name. So, you can follow the approach as,
awk -F "," '{ print $1 }' create_files | while read a; do touch $a; done
I am using the awk
command to extract the first column alone to have the file names and based on the first column I create the new files using the while
loop and touch
command.
However, I assume the first column will always be unique. If it is not unique, we may need to follow another approach. For that you need to edit your question and mention what file name convention you are planning on.