-1

In my project,we are using JCSV for reading comma separated values.We wanted to extend the support to read pipe delimited text as well. The text is something like this:

NAME|AGE|Sex|Country|
Alpha|22|M|Switzerland|
Beta|23|F|Germany|
Javaenthu
  • 5
  • 3
  • Why do you need a library? Just split the lines on a pipe... – OneCricketeer Nov 30 '16 at 13:58
  • Show us what you have tried. Does it work? –  Nov 30 '16 at 13:58
  • @cricket_007: For simple cases you don't need a library. But to support multiline fields and the separator character inside field values a simple split isn't enough. – vanje Nov 30 '16 at 14:07
  • Fair point. Anyways, Apache Commons is likely a better candidate. https://commons.apache.org/proper/commons-csv/user-guide.html#Working_with_headers – OneCricketeer Nov 30 '16 at 14:12

1 Answers1

0

use append method of StringBuilder class and append | after each column of array