Member Avatar

apparently my data is too big to be split at every newline..

any idea how to split every 4th newlien?

Recommended Answers

Simplest would probably be to use split with second argument 1 or partition method four times and return or yield those as values, joining together if you really need the lines as one chunk.

Jump to Post

All 2 Replies

Simplest would probably be to use split with second argument 1 or partition method four times and return or yield those as values, joining together if you really need the lines as one chunk.

Data length is data length and will be the same no matter where you split. If you read one record at a time instead of the entire file it should not be a problem. More info is necessary though. What code are you using and how big is the file. In today's gigabytes of memory world, very few files are too large so it may also be something else that is causing the problem,

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.