In Vb6, is there a way to go back some n lines before the main line when reading a file?
-
I am trying to extract some portions of a file. When a keyword is found, I will get the first few lines before it and output it in a file. is there a way for this in vb6? any ideas? thanks.
-
Answer:
Simply read the whole file into an array. You can then loop through the array quite easily to find your keyword and get the previous lines. ie. Let's call the array LINES(). If the keyword is on LINES(27), then you could easily iterate backwards to get LINES(26), LINES(25) and LINES(24). Does that make sense? If not, contact me and I'll write some code for you tonight.
clueless at Yahoo! Answers Visit the source
Related Q & A:
- How to delete a particular line from a file?Best solution by Stack Overflow
- How to count the number of lines in a file using Bash?Best solution by Stack Overflow
- Is there a way to go from England to Amsterdam by train?Best solution by Yahoo! Answers
- Is there a way to edit a line of tracking interference down recorded video tape on computer?Best solution by Yahoo! Answers
- Is there a way to go with bus or train to new york from chicago?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.