Hi all
I have a file which contains a header, trailer and lines of data, I would like to append a count of the data lines in the file to the end of the trailer.
For the moment I have managed to generate the line count on a seperate line at the bottom of the file. For now it seems that I have to delete the carraige return at the end of the pen-ultimate line to have my trailer with line count at the end. The end of the pen-ultimate line has fixed text so I was thinking of using the following type script
sed -e 's/fixed text$/fixed text/g' file >> other file
but it doesn´t seem to work any ideas help greatly appreciated.
TIA
Anthony
I have a file which contains a header, trailer and lines of data, I would like to append a count of the data lines in the file to the end of the trailer.
For the moment I have managed to generate the line count on a seperate line at the bottom of the file. For now it seems that I have to delete the carraige return at the end of the pen-ultimate line to have my trailer with line count at the end. The end of the pen-ultimate line has fixed text so I was thinking of using the following type script
sed -e 's/fixed text$/fixed text/g' file >> other file
but it doesn´t seem to work any ideas help greatly appreciated.
TIA
Anthony