Hello,
I'm looking for a wait to count the number of occurrences of a certain string of characters within a file. The file that I trying to parce has segments within the file that have a header and footer to each segment and I'm trying to do a count of the header string and compare it to a count of the footer string to verify the integrity of the file.
Example file:
HEADER misc text and numeric values FOOTER HEADER more misc info FOOTER HEADER etc etc FOOTER
There are no carriage returns within the file, and it's about 50 to 60MB text file so the process needs to be somewhat efficient as a short processing timeframe is required.
I've done several searches and tried using wc, tr, and sort is a variety of different ways but I'm no closer to finding a solution. I'm a novice to the use of utilities like sed or awk, but ideas using them are welcome.
Other general info: I use ksh on AIX 5.3. Thanks for any help!
I've got a follow up bump to add to this. I need to count the number of rows that start with the number 10. I can't count the instances because 10 often appears in the rows as well.