Page 1 of 1

Command Line Bookmarking for Multiple files...

Posted: Thu Jun 30, 2005 4:37 pm
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!

Posted: Fri Jul 01, 2005 8:52 am
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

Posted: Fri Jul 01, 2005 7:53 pm
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?

Posted: Sat Jul 02, 2005 10:29 am
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.

Posted: Sat Jul 02, 2005 3:45 pm
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.

Python Script and Unix type commands?

Posted: Sat Jul 02, 2005 7:02 pm
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?

Posted: Sat Jul 02, 2005 8:08 pm
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