Parsing plain text to some structured object

Posted by Jeriho on Stack Overflow See other posts from Stack Overflow or by Jeriho
Published on 2010-04-26T12:00:32Z Indexed on 2010/04/26 12:03 UTC
Read the original article Hit count: 261

Filed under:
|
|

I am working on parsing plain text and converting it to key-value pairs. For example, plain text:


some_uninteresting_thing

key1 valueA, valueB, valueC

key2 valueD

key3 valueE valueF

key4 valueG(valueH, valueI)

key5 some_uninteresting_thing valueJ some_uninteresting_thing

key6 some_uninteresting_thing


(key6 shouldn't be mapped because has no appropriate values) As you can see plain text is lenient. What java library can handle this? If no such library exist, any suggestions on algorithm to do this.

© Stack Overflow or respective owner

Related posts about parsing

Related posts about java