I have file.txt - a database with 2 fields. Each line contains
1) a reference number (4 digit integer)
then a full-stop to seperate the 2 fields
2) A string name
I am using a bash shell script to select each line in turn, and output the reference number:
cat file.txt | while read LINE ;
Which iterates through the database, but prints the whole line. I only want to print the first 4 digits, is there any way you can use the cut command to cut off the full stop and string on each line?