Want to remove specified text string from file headers

WhiteKnight

Platinum Member
May 21, 2001
2,952
0
0
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?
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,838
4,817
75
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.