• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use String.split method.
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Ranch Hand
Posts: 262
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Do you want ants? Because that's how you get ants. And a tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic