S
Sharp
Hi
Consider a text file containing text formatted as follows:
// input.txt
1234 aaaaaaaaaaaaaaaaaaaa
1232 bbbbbbbbbbbbbbbb
3454 cccccccccccccccccc
3214 dddddddddddddddd
1234 aaaaaaaaaaaaaaaaaaaa
1232 bbbbbbbbbbbbbbbb
3454 cccccccccccccccccc
3214 dddddddddddddddd
Expect the following result when parsed:
// result.txt
1234 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1232 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
3454 cccccccccccccccccccccccccccccccccccc
3214 dddddddddddddddddddddddddddddddd
As you can see each row of text is wrapped into 2 rows, but in reality there
are many wraps.
My proposed approach:
1. create 4 string buffers
2. read each line using filereader/buffered reader
3. append the data into the corresponding string buffers
Is there a better way of doing this?
Cheers
Sharp
Consider a text file containing text formatted as follows:
// input.txt
1234 aaaaaaaaaaaaaaaaaaaa
1232 bbbbbbbbbbbbbbbb
3454 cccccccccccccccccc
3214 dddddddddddddddd
1234 aaaaaaaaaaaaaaaaaaaa
1232 bbbbbbbbbbbbbbbb
3454 cccccccccccccccccc
3214 dddddddddddddddd
Expect the following result when parsed:
// result.txt
1234 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1232 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
3454 cccccccccccccccccccccccccccccccccccc
3214 dddddddddddddddddddddddddddddddd
As you can see each row of text is wrapped into 2 rows, but in reality there
are many wraps.
My proposed approach:
1. create 4 string buffers
2. read each line using filereader/buffered reader
3. append the data into the corresponding string buffers
Is there a better way of doing this?
Cheers
Sharp