I have file input.txt
with below data in TAB delimited format-
23776112 Inactive Active
23415312 Inactive Active
As per requirement, Inside the while loop, I want to use cut 1st column's data and print it -
Below is the part of code-
......
......
while read line
do
SN=`echo ${line}|cut -d ' ' -f1`
echo $SN
done < input.txt
....
....
To use the tab as delimiter above, I am using Ctrl V Tab
But the output is not as expected.I am getting O/P-
23776112 Inactive Active
23415312 Inactive Active
Whereas I want O/P like -
23776112 23415312
cut -f1 input.txt
should be enough – RomanPerekhrest Sep 26 '17 at 13:40