0

I have a text file, need to parse the file, and send only 4000 character from that file for further processing. It is possible, I might have more than 4000 characters within a single line. Need to find a way to split the line without breaking the sentence.

Senthil_Arun
  • 1,008
  • 9
  • 15
  • 2
    What have you tried so far, and what problems are you having exactly? – bassfader Mar 05 '20 at 20:32
  • See [get string truncated to max length](https://codereview.stackexchange.com/questions/101017/get-string-truncated-to-max-length) – Wyck Mar 05 '20 at 20:47

1 Answers1

1

Read each character one at a time instead of line by line. When you get to 4000 characters go back to the previous full stop and send that. Then start again until you finish reading all characters. Perhaps if you get to a new line you can also split there.

Michael Ceber
  • 2,304
  • 1
  • 11
  • 14