Not sure the best way to do this. Need to take the first 4 fields of a file that is comma separated and put them into a new file. The file may have 30 lines or 300 lines. Need to read through each line.
Would I use a for loop to do this or a read command
count the number of lines in the file.
numberoflines=`wc -l $file'
for $numberoflines in
cut -c 1-4 > file.tmp
or would read be better. not sure how this would be structured.
Thanks for the help