I have a tab delimited text file with text like this:

Wed Jun 13 01:00:19 2012 | error | client xx.xxx.xxx.x | rdy 784 bsy 16

The pipe | signifies that the tab delimiter. I need to convert this into a CSV file using Java. I also need to split the "rdy 784 bsy 16" into two values. What is the best way of doing this?

Use OpenCSV. You can use tabs delimiters with a CsvReader and a CsvWriter for the output.

Use regex to split "rdy 784 bsy 16".

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.