I have a file named test.txt which has the following content
123,2,1
I want to print the contents of the file without "123,"
I used the following
awk -F, '{print substr($0, index($0, $2))} text.txt'
It doesn't work properly tho, it prints 23,2,1
But when I run it for this text '123,5,1' , it works without a problem (it prints 5,1)
awk -F, '{print $2}' filewill does the job for you.