I need to read text from a CSV file where i use "|" as seperators. I am wondering if i should be using String Tokenizer or Regular expressions. Can any body help me in deciding wich is faster.
Thanks in advance
Arulanand Dayalan
Ranch Hand
Joined: Aug 10, 2005
Posts: 124
posted
0
Regular Expression are faster.
Thanks and Regards, Arul.
Alan Moore
Ranch Hand
Joined: May 06, 2004
Posts: 262
posted
0
It doesn't matter whether StringTokenizer or split() is faster; neither one is the right tool for this job. For standard CSV data, I would recommend a dedicated CSV parser/tokenizer, but it sounds like Stephen Ostermiller's StringTokenizer replacement will suit your needs better: