• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Parsing pipe delimitated text file suing ExcelCSVParser

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All!
I want to convert the pipe delimitated text file into an XML file and then parse it. The file has a field where there occurs a pipe inside the single field enclosed by inverted commas..for example A|B|"C|D|E"|F.I was using the LabeledCSVParser before till i knew about this anomaly of pipes within a single field.
Now, previously in the XML file, i was accessing the label easily using getValueByLabel(LabelName) method of LabeledCSVParser. Now, how can i access the labels using ExcelCSVParser.
Any idea would be highly appreciated.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where did you get the classes ExcelCSVParser and LabeledCSVParser from? Those are not standard Java classes. I did a Google search and these are probably from the Ostermiller utilities, correct?
 
Piyush Mattoo
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes..correct. I did some reserach and found out that Ostermiller Utils is the best way of parsing the CSV file and ExcelCSVParser is one you i got to be using for reading in labels which has the delimiter inside the field.
I am converting CSV file delimited by Pipes into an XML file and then parse it.While parsing the file using ExcelCSVParser, i cannot find a way to get the value of the lable like to use to get in LabeledCSVParser using getValueByLable(Label) method.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic