I have file in which the data looks like this,
01,0000000,xxxxxxx/
02,xxxxxxxx,yyyyyy/
03,test1,41203016,,/
01,0000000,xxxxxxx/
02,xxxxxxxx,yyyyyy/
03,test2,41203017,,/
01,0000000,xxxxxxx/
02,xxxxxxxx,yyyyyy/
03,test3,41203018,,/
I would not know what values will be there in place of test1, test2 and test3 in my file.
I wrote a command to get these values from the file,
grep "^03,.*,.*$" file.dat | cut -d"," -f2
this returns,
test1
test2
test3
Is there a way I can get a specific occurence (ex: 5th or 9th) of this string. let say in this case, can I get only test2?
Appreciate your help.