in my file there are few lines that has more than 3000 characters per line and as soon as I run the above command it cores, strings core reveals that the awk is failing because input string too long, limit. can i get some help from the experts to find an alternative command for what I am trying to do.
Thank you so much, can you please explain me what exactly you are doing. by the way it did work and thank you so much. I would like to understand your code.
while read -r junk other; do printf "%s\n" "$other"; done < filename
It is a while loop. In every cycle read a line into the two variables junk and other , where the first word lands in junk . The spaces around the first word are deleted. The source of the read is the file filename because the whole while-do-done block is redirected.
Then the variable other is printed.
The loop continues with the next read. It ends if the read fails, normally when it is beyond the last line (end of input reached).