Select every other line of a text file on Textmate
Lets say you have a YouTube transcript text file structured like this:
0:00
so I think the difference in in a poem
0:05
or a work of literary artists that we
0:07
say story know is that it isn’t for the
You want to select the lines with numbers and delete them.
In my case I’m using the Textmate text editor, but the following technique using regular expressions, sequences of characters that specify a pattern to match on a text, should work with other editors, like Notepad++, too:
- Press Cmd-F to open the search dialog box. Make sure the Regular Expression checkbox is ticked.
- Put the following in Find:
([^\n]\n)[^\n]\n?
- And this in Replace (notice the space before $):
$1
- Click Replace All.
· ˖ ✦ . ˳
Possibly Related:
- Reverse chronological numbers in a text document with Textmate
- Search for text in filenames in macOS
- ESAK
- Trust: A long time to build, a short time to destroy
- Rhythm
˳ · ˖