Next Generation Emulation banner

1 - 11 of 11 Posts

·
AKA snkmad
Joined
·
4,030 Posts
Discussion Starter · #1 ·
I need a program, that i can set a word for him to search, and if found, delete a pre-defined numbers of lines, below or above.

Like search for the word "Telefone", if found, delete 7 lines above this word. And do this for the rest of the file.

Can it be done?
And yes, i know it sounds crazy...but look at my nick.... :thumb:
 

·
Premium Member
Joined
·
6,338 Posts
I'm... not really sure what you mean. For your Telefone example you mean delete 7 lines above the word for each instance of the word?

I could probably code something like that in C++ or Java, although I'm kind of busy studying for my math exam at the moment.
 

·
AKA snkmad
Joined
·
4,030 Posts
Discussion Starter · #3 ·
Let me make myself more clear.
Actually i want to delete 19 lines, and i want to delete the line that contains the word i searched and the other 18 above it, no matter what they are - size, type, entry...
Oh, if it isnt ask to much, that i could change the word to be search.
 

·
War Games coder
Joined
·
1,926 Posts
Yeah... it can be done... pretty much any halfway decent shell script or C/C++ coder should be able to crank this sort of thing out in minutes. However, I know of no COTS program that does this....
 

·
AKA snkmad
Joined
·
4,030 Posts
Discussion Starter · #5 ·
KillerShots said:
Yeah... it can be done... pretty much any halfway decent shell script or C/C++ coder should be able to crank this sort of thing out in minutes. However, I know of no COTS program that does this....
COTS program?
 

·
War Games coder
Joined
·
1,926 Posts
Mad said:
COTS program?
COTS = Commercial Off The Shelf - A common term for engineers. Sorry, I should have defined it.
 

·
AKA snkmad
Joined
·
4,030 Posts
Discussion Starter · #8 ·
Thx guys, now i know it can be done and im not that crazy ;)

Any coder reading this? Just a simple GUI, and the ability to change the search terms is enough for me.
 

·
Premium Member
Joined
·
6,338 Posts
Well, I made a program in Java that can do it. If you still need it then I can send it to you. I would have written it sooner but it's exam time here so I didn't have much time:S.
 

·
AKA snkmad
Joined
·
4,030 Posts
Discussion Starter · #10 ·
Yeah i really need it!
And if its not asking to much, could you make and option to export the search results?
 

·
Premium Member
Joined
·
6,338 Posts
It's no problem, just glad I could help:). The program I wrote should do what you're looking for. It allows you to open a file and view it, delete the lines as you described, save the search/delete results, and save the file. It has a GUI and allows you to enter the number of lines to delete as well as the keyword. It's written in Java so you need to have Java and JVM installed. I included a batch file to make it easy to run (just double-click the DeleteLine.bat file).
 
1 - 11 of 11 Posts
Top