Results 1 to 2 of 2
Thread: Reading log
- 03-13-2011, 07:52 PM #1
Member
- Join Date
- Mar 2011
- Posts
- 1
- Rep Power
- 0
Reading log
I have a text file with a lot of line's with this build.
10.1.1.77 - - [06/Jan/2011:07:55:36 1000] "GET /ELO/Language.do?language=Nl HTTP/1.0" 200 9584
Now I need to read the different items :
10.1.1.77 IP adres
- possible user name
- possible remote user
[06/Jan/2011:07:55:36 1000] date and hour of the request
"GET /ELO/Language.do?language=Nl HTTP/1.0" First line of the request
200 State
9584 Number of bytes
Now I whas planning to read the file using a scanner to read line by line. But I have no idea how to use different delimiters. I have looked around and found something about the use of regex but I don't understand the use.
Can anyone explain? Thx all
-
Because you mentioned you looked around but couldn't find tutorials of regex - here is the official tutorial for you:
Lesson: Regular Expressions (The Java™ Tutorials > Essential Classes)
Don't worry it is pretty straight-forward.
Similar Threads
-
Reading from File
By eevaa in forum New To JavaReplies: 4Last Post: 05-22-2010, 08:18 AM -
Reading a .doc file
By ujjal.ruet in forum New To JavaReplies: 1Last Post: 05-11-2010, 09:14 PM -
reading from a .txt
By Flamespewer in forum New To JavaReplies: 1Last Post: 09-14-2009, 08:35 AM -
problem with reading excel sheet data reading using poi libraries
By sandeepsai17 in forum New To JavaReplies: 5Last Post: 08-21-2009, 11:03 AM -
Reading from csv file.plz help!!!!!!!!!!
By sanjayksaini in forum New To JavaReplies: 1Last Post: 12-19-2008, 07:41 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks