Can I search a 800Meg text file for a specific piece of text, then delete all lines after that text?
-
Either delete all lines after the text and save the file or save the text from line 1 to the specific piece of text into a new file. I would like to do this using a program on windows (sed or awk) ?
-
Answer:
That doesn't seem too hard, but not knowing the language you are using I can't really give you any specifics. I would just read through the file line by line (using some getLine() function), then search each line for the text you are looking for. After finding it, I guess it's personal preference how you want to save it. Either way seems equally efficient to me. That's about all I can offer you (I'm not a professional or anything, heh), but I hope that at least points you in the right direction. Consult your programming language's specific documentation to get a better idea (unless you are using the MSDN library - good luck getting any useful info out of that).
asims at Yahoo! Answers Visit the source
Other answers
try using efficient string searching algorithms http://en.wikipedia.org/wiki/String_searching_algorithm
Pierre T
Related Q & A:
- Where can I get a good online file storage?Best solution by dropbox.com
- Can I turn a DVD Video file into a Regular Video file?Best solution by wikihow.com
- How can I attach more than one file at a time in Yahoo mail?Best solution by pc.net
- Can I use a 4 ohm crossover with a high pass slope of 24 db with a 6 ohm tweeter that has a 6 db slope?Best solution by termpro.com
- Can I get a job while I'm a foreign Student in Florence at florence design academy aca..is it legal?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.