Results 1 to 1 of 1
Thread: Need help to parse text files.
- 11-11-2011, 04:11 PM #1Member
- Join Date
- Nov 2011
- Rep Power
Need help to parse text files.
I am learning Java and need some assistance.
I'm trying to make a program that can scrape some data out of a text file and get certain important parts. The text files contains the source code for an ebay auction. What I am trying to do is grab key parts like the price, item location, etc.
I can get the source code and save it to a file and I can read and write files. What I need to figure out is how to grab that particular part of the file.
I know that I can use regular expressions to match things that I'm looking for, but how can I grab a part of the file that is after the match to the regex? I was able to match a line in the file that has the particular piece of info I want and store that in a separate string, but the line is quite long and I'm not sure how to break it down to get at what I need, or handle a situation where the rest of the information is on the next line.
Ideally I would like to get whatever is left on the line after the regex match, and then do a string tokenizer with a space delimiter which should capture the data and I can have it end when it reaches something like a < or "
I suppose I could take a whole line and tokenize it but there has to be a better way. Any assistance is appreciated.
- By axenos in forum Advanced JavaReplies: 9Last Post: 04-22-2011, 05:42 AM
- By renu in forum New To JavaReplies: 10Last Post: 04-12-2011, 07:00 PM
- By JordashTalon in forum New To JavaReplies: 0Last Post: 03-05-2009, 12:08 AM
- By Farzaneh in forum New To JavaReplies: 2Last Post: 08-27-2008, 04:20 PM
- By erhart in forum Advanced JavaReplies: 8Last Post: 01-19-2008, 05:43 AM