wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes How to tokenize a line based on delimiter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to tokenize a line based on delimiter "at"?" Watch "How to tokenize a line based on delimiter "at"?" New topic
Author

How to tokenize a line based on delimiter "at"?

Deepak Kumar
Ranch Hand

Joined: Nov 05, 2007
Posts: 62
Hi All,

line1--> HelloAult (Hitn: Delhi India(255)) at [06/26/2008 13:40:17.13]:
line2--> HelloAult (Hitn:96 @ 26c62) at [01/29/2008 10:50:11.26]:

how to tokenize line1 and line2 based on the delimiter "at"
such that I get two tokens each from line1 and line2 as below.If not whats's the better solution to get two tokens each from line1 and line2 ??

line1's first token--> HelloAult (Hitn: Delhi India(255))
line1's second token--> [06/26/2008 13:40:17.13]:

line2's first token--> HelloAult (Hitn:96 @ 26c62)
line2's second token--> [01/29/2008 10:50:11.26]:


Thanks & Regards,
Deepak


Thanks,
Deepak
vanlalhmangaiha khiangte
Ranch Hand

Joined: Sep 11, 2006
Posts: 170
You can use String.split method.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38045
    
  22
Originally posted by vanlalhmangaiha khiangte:
You can use String.split method.
Agree. But it's probably worthwhile learning about regular expressions so as to know what you can use as an argument to String#split.
Alan Moore
Ranch Hand

Joined: May 06, 2004
Posts: 262
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to tokenize a line based on delimiter "at"?
 
Similar Threads
How to get Yesterday's date
Mock exam Q
Tokenizing with regex pattern. Little confused!
Can get the Form Feed "\f" to work!
SSL error