How to make Excel's "Text to columns" in Java?

1.2k Views Asked by At

I am trying to write something in Java that basically does the same thing as "Text-to-Columns" in Excel. I have a long string of data (parsed out from some HTML) and I formatted it to divide the data I need by a semicolon.

For example

Str = brand name;1242141;brand name;753216;brand name;2356123;brand name;656258;

So I want each of the brand names and numbers to be in their own cell. Any ideas on how to do this?

1

There are 1 best solutions below

0
On

http://www.tutorialspoint.com/java/java_string_split.htm

Str.Split(";")

Should give you the information that you would like. Getting the information into Excel is a whole other bag of cats, but

Best way to export data from Java to MS Excel

Is probably a great way to start.