How to select and keep some lines in a .txt file and delete the rest

Joined
Mar 12, 2015
Messages
1
Reaction score
0
Hello guys.

I have a huge txt file with thousands of paragraphs. Every paragraph starts with * (thats very helpful I guess) and it has a title (see the example).


*Here is the title (some data, 0.9 deg.) -

Text here........... until a new one!

*Here is the title (some data, 0.0 deg.) -

Text here........... until a new one!


At the end of the title, there are parenthesis and inside of them there are some numbers in degree format.

I want to keep only the 0.0 degree title and the text underneath and every other title and text to be delete. How can I do that? I will earn a valuable time....
 
Joined
Mar 14, 2015
Messages
19
Reaction score
0
Viti, are you familiar with BBEdit from Barebones Software? Written by Rich Siegel, it is an excellent, solid, robust, multi-purpose text editor for programmers, HTML coders, regular writers, etc.

Going by what you have written above, I believe that you could very easily achieve your goals using some of BBEdit's features, such as "Process lines containing..." and grep patterns. Grep patterns are very powerful once you begin to understand them and know how to use them.

I use these two features on a regular basis on a number of websites that I own and operate, and it saves me lots of time, because you can do global search and replace.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top