google / guava

Google core libraries for Java
Apache License 2.0
50.11k stars 10.89k forks source link

Fixed length format-Using Splitter #1217

Closed gissuebot closed 9 years ago

gissuebot commented 9 years ago

Original issue created by prabhathkesav on 2012-11-29 at 11:31 AM


I am having a Flat file,I am using guava splitter to split the lines,I need to store a fixed length file(of length 650) into one array and other so on while reading Flat File,The real issue is line should be read including whitespaces,Any solutions?

The snippet is given below: Iterable<String> splitStrings = Splitter.fixedLength(640).split(line);

gissuebot commented 9 years ago

Original comment posted by kevinb@google.com on 2012-11-29 at 02:44 PM


As explained on http://guava-libraries.googlecode.com, please post requests for help like this to Stack Overflow.

It's still often us who answer the question, but the information is then archived in the right place. And very often a user beats us to it or does a better job than we would have.


Status: Invalid

gissuebot commented 9 years ago

Original comment posted by SeanPFloyd on 2012-12-03 at 09:25 PM


@Op If you have a look at Spring Batch, it's FlatFileItemReader could be what you need: http://static.springsource.org/spring-batch/reference/html/readersAndWriters.html#flatFileItemReader