Skip to main content
added 4 characters in body; edited tags; edited title
Source Link
Gilles 'SO- stop being evil'
  • 865.3k
  • 205
  • 1.8k
  • 2.3k

I need to replace Replace multiple lines in a text data file by a fixed pattern

Okay, looking for a quick way to do this. I have a list of line numbers that need to be changed in a text data file. The 16 bit pattern on that line can be anything but I need to change to change it to read XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX based solely on the line number. Again I have a long list of line numbers I know that need to be changed. There is no discernible pattern to the lines that need to be changed. (I did not write the data pattern but I know what lines need to be changed to read all X's.) I read through a lot of the answers here and none really quite deal with this.

If this isn't clear I'll put it another way...

Change lines 26115, 32198, 37256, 40001, 40023 in a file to read XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. I have over 100,000 lines that need changing in a 1.9 million line file.

I need to replace multiple lines in a text data file

Okay, looking for a quick way to do this. I have a list of line numbers that need to be changed in a text data file. The 16 bit pattern on that line can be anything but I need to change to change it to read XXXXXXXXXXXXXXXX based solely on the line number. Again I have a long list of line numbers I know that need to be changed. There is no discernible pattern to the lines that need to be changed. (I did not write the data pattern but I know what lines need to be changed to read all X's.) I read through a lot of the answers here and none really quite deal with this.

If this isn't clear I'll put it another way...

Change lines 26115, 32198, 37256, 40001, 40023 in a file to read XXXXXXXXXXXXXXX. I have over 100,000 lines that need changing in a 1.9 million line file.

Replace multiple lines in a text file by a fixed pattern

Okay, looking for a quick way to do this. I have a list of line numbers that need to be changed in a text data file. The 16 bit pattern on that line can be anything but I need to change to change it to read XXXXXXXXXXXXXXXX based solely on the line number. Again I have a long list of line numbers I know that need to be changed. There is no discernible pattern to the lines that need to be changed. (I did not write the data pattern but I know what lines need to be changed to read all X's.) I read through a lot of the answers here and none really quite deal with this.

If this isn't clear I'll put it another way...

Change lines 26115, 32198, 37256, 40001, 40023 in a file to read XXXXXXXXXXXXXXX. I have over 100,000 lines that need changing in a 1.9 million line file.

Source Link

I need to replace multiple lines in a text data file

Okay, looking for a quick way to do this. I have a list of line numbers that need to be changed in a text data file. The 16 bit pattern on that line can be anything but I need to change to change it to read XXXXXXXXXXXXXXXX based solely on the line number. Again I have a long list of line numbers I know that need to be changed. There is no discernible pattern to the lines that need to be changed. (I did not write the data pattern but I know what lines need to be changed to read all X's.) I read through a lot of the answers here and none really quite deal with this.

If this isn't clear I'll put it another way...

Change lines 26115, 32198, 37256, 40001, 40023 in a file to read XXXXXXXXXXXXXXX. I have over 100,000 lines that need changing in a 1.9 million line file.