Java Help in Splitting a String

Hi,

I have received a csv file content as string. Now I want to split the string so that I can get the individual record and start processing.

To split the recod I have used String.split(“\n”)

I have tried with StringTokenizer st=new StringTokenizer(“\n”)

Both are not giving the desired result?

Any help in this?

Cheers,
Sasanka

why not use built in service pub.string:tokenize - this itself is a java service.

-regards
DC

Review the Flat File Schema Developer’s Guide. IS has facilities to parse the file for you and return records to your service for processing. No need to split/tokenize yourself.

Hi,

You can use flatfile schema to convert CSV file to a Document.

Use pub.flatFile:convertToValues and specify the flatfile schema.

Regards,
Nat

Here’s a link which explains the flat file conversion if you haven’t done it before.

[url]http://webmethodssag.blogspot.com/2010/12/handling-csv-files.html[/url]