I have a file that I need to merge with another like file. Normally I remove the trailer reocrd and merge the file and update the trailer record of the second file. I did a WC -l on the first file before I removed the trailer record, and again afterwards. The count came back the same. I opened the file with textpad and found that the file with the trailer record had 1 more line than what WC -l was bringing back. I need help from the experts on this.
It might be the last line is lacking an ending linefeed.
Hi Jill,
How can I view or determine if the linefeed is there are not? What do I need to look for in the file?
---------- Post updated at 10:40 PM ---------- Previous update was at 10:39 PM ----------
when I do a wc -w it returns 3 words less, which make up the trailer record.
od -c file | tail -2
Once again, thank you very much..
---------- Post updated at 11:23 PM ---------- Previous update was at 11:15 PM ----------
Hi Jill,
So i should see \n in the results of od for the given file if there was a new line other wise is it counted as part of the previous line in the file?
otherwise it is silently ignored as not being a line in the first place.
Once completed the information into the file, press enter , save and exit.
then check wc -l is working properly