rule based file parsing

Posted by user359490 on Stack Overflow See other posts from Stack Overflow or by user359490
Published on 2010-06-06T02:17:45Z Indexed on 2010/06/06 2:22 UTC
Read the original article Hit count: 249

Filed under:
|
|

I need to parse a file line by line on given rules.

Here is a requirement.

file can have multiple lines with different data..

01200344545143554145556524341232131 1120034454514355414555652434123213101200344545143554145556524341232131 2120034454514

and rules can be like this.

if byte[0,1] == "0" then extract this line to /tmp/record0.dat if byte[0,1] == "1" then extract this line to /tmp/record1.dat if byte[0,1] == "2" then extract this line to /tmp/record2.dat

I am looking for any language which can do this in a fast manner with a very long file size like >2 GB.

Appreciate all the help in advance.

Thanks

© Stack Overflow or respective owner

Related posts about java

Related posts about ruby