• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Want to remove specified text string from file headers

WhiteKnight

Platinum Member
I have a data set of approximately 400 GB of text files (~2 MB each), all with a common header. I'm looking for a program to process this entire data set, removing a specified string from the header of each file. Can anyone recommend a program to do this?
 
Do you want to remove entire lines, or just parts of lines?

'find /v "theheader" < infile > outfile' at a command prompt will remove lines with theheader in them. See also findstr if you need primitive regular expressions or something.

sed will let you remove parts of lines. 'sed -i~ -e "s/theheader//" thefile' removes the first instance of theheader from every line of thefile. You can get a copy of sed here.

In either case, you'll probably need to use for. Type "for /?" at a command prompt for instructions.
 
Back
Top