Hi folks,
Happy new year.
I have a file 'filename' that i wd like to split basing on the contents in the last column.
The 'filename' content looks like
256772744788,9,11
256772744805,9,11
256772744792,9,11
256775543055,10,12
256782625357,9,12
256772368953,10,13
256772627735,10,13
256782853530,9,14
256782676830,9,28
256392752548,9,37
256782610403,9,38
256775590939,9,38
and i would like output files like 'file11', 'file12', 'file13', 'file 14', 'file28' etc with content
[cat file11]
256772744788,9,11
256772744805,9,11
256772744792,9,11
[cat file38]
256782610403,9,38
256775590939,9,38
I used this for loop but only created empty files.
[for (( i = 11; i <= 115; i++ )); do grep ',$i' cugnums.csv > file$i;done]
The last column has integer values from 11 to 115