Hi there,
I have kludged together a KSH script to add an "index" field to a file, but it's extremely slow, because I'm reading each line of the file into a variable, then adding the index variable then the rest of the line.
This is how I did it:
while read buffer
do
index=`expr $index + 1`
echo "$index $buffer" >> NEWFILE
done < inputfile.txt
Is there a better way to do this? Thanks much!
I have kludged together a KSH script to add an "index" field to a file, but it's extremely slow, because I'm reading each line of the file into a variable, then adding the index variable then the rest of the line.
This is how I did it:
while read buffer
do
index=`expr $index + 1`
echo "$index $buffer" >> NEWFILE
done < inputfile.txt
Is there a better way to do this? Thanks much!