0
I want to extract the first 2 letters of each line from a file and save it in a variable and print it in a single command. Can anyone help me with the command? Considering my file has 20 - 30 lines and file name is extracter.txt.
0
I want to extract the first 2 letters of each line from a file and save it in a variable and print it in a single command. Can anyone help me with the command? Considering my file has 20 - 30 lines and file name is extracter.txt.
1
The simplest way to get the first 2 chars of each line is
cut -c 1-2 extracter.txt
Your question is not clear about what you want to save into a variable.
I just want to print it on screen. – Aravind S – 2016-01-29T15:58:16.197