Reputation: 27
Example:
hRihdNeI
After removing letters: R , h , N , I
We get letter:
hide
Please note that there will be million of lines, all lines will have different length, they can be 5 characters long or even 50 characters long
Upvotes: 0
Views: 795
Reputation: 1806
If you use EmEditor, open the file, press Ctrl
+ H
to open the Replace dialog box, click Advanced... and click Reset button to make sure all options are default, click OK.
In the Replace dialog box, enter:
Find: (.).
Replace with: \1
Set Regular Expressions and Match Case options, and click Replace All button.
After replacing all, some versions of EmEditor might have trouble refreshing the editor view. You can scroll up and down to see the changes. You can also press Alt
+ F3
to erase matching highlight. Finally, you can click the File menu, Save As to save the result as a different file name. I tested with a 10 million random ASCII text file.
Reference: Removing every other character in a string using Java regex
Upvotes: 1