Command Line Bookmarking for Multiple files...

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
jpe110
Posts: 6
Joined: Thu Jun 30, 2005 4:26 pm

Command Line Bookmarking for Multiple files...

Post by jpe110 »

I have an analytical instrument that outputs data in .txt files. These text files are exactly identical, as to the line numbers that the information is on. However, it also inserts some text on specific lines that I'd like to delete. I need a way to bookmark specific lines so I can run the delete bookmarked lines and remove the unwanted text. Does anyone know how to do this...over maybe not have to go through the bookmark and just delete the lines I don't want? I put "command line" in the heading b/c i thought it would be necessary, but if there's a way to do it in the GUI would be nice to. Thanks!
bveldkamp

Post by bveldkamp »

If you know the exact line numbers it's easy: Record a macro that jumps to the specific line (Search | Goto) and sets a bookmark (Ctrl+F2). Repeat for all lines you want to delete. When you're finished, Edit | Delete | Bookmarked lines

HTH, Berend
jpe110
Posts: 6
Joined: Thu Jun 30, 2005 4:26 pm

Post by jpe110 »

I'm looking for a way to automate this....I have 96 files at a time that require lines 1-22,523-526,1026-1029, and 1529-1530 to be deleted. If I can do this with a macro...how do I do that?
bveldkamp

Post by bveldkamp »

OK, in that case I usually use unix-style command line tools, in this case probably 'head' and 'tail'. There are Windows versions around as well.
User avatar
talleyrand
Posts: 624
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post by talleyrand »

Check your PMs, jpe. I jotted down a quick python script that should process all the files in a directory and remove those lines but a sample before and after file would let me know I did it correctly.
I choose to fight with a sack of angry cats.
jpe110
Posts: 6
Joined: Thu Jun 30, 2005 4:26 pm

Python Script and Unix type commands?

Post by jpe110 »

Hi talley and others...

First off, I'm wondering what program I can use in windows to do these "unix type commands" that someone mentioned. Additonally, talley...what is a python script and a "PM"? If you want a copy of some of these files I'm trying to edit I can get you those, where do you want them sent?
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Hello jpe110

"PM" is Private Message on this forum. Look in center of forum page, near top, and you may see something that looks like "You have 1 new message".

"python" is a scripting language, like perl
Hope this was helpful.............good luck,
Bob
Post Reply