I need to do a task depending on first 5 chars in each line of a file.
This script does not work (it shows each word as a line)?
for rec in `cat myfile`
do
echo $rec | cut -c1-5
done
MYFILE looks like this
ABCDEsome string of data
FRED some string of data
HARRYsome string of data
This script does not work (it shows each word as a line)?
for rec in `cat myfile`
do
echo $rec | cut -c1-5
done
MYFILE looks like this
ABCDEsome string of data
FRED some string of data
HARRYsome string of data