How to split text file by 5000 characters?

zmike

Client
Регистрация
24.10.2019
Сообщения
156
Реакции
10
Баллы
18
How to split text file by 5000 characters?
And copy the 1st 5000 characters, then copy the 2nd 5000 characters?
When split the text file, need to finish the last period (.)
So that a full sentence is not broken.
 
regex

(^(?:\S+\s+\n?){1,{-Variable.numercharacters}})
 
  • Спасибо
Реакции: zmike
regex

(^(?:\S+\s+\n?){1,{-Variable.numercharacters}})

@aleksa77

Thank you for sharing!

Is it like this?



tN9sTPu.jpg
 
How can I get the first 5000 characters, then the second, third and fourth (if any)

I can only get the first match

qZ8H8UB.jpg
 
your questions are from total beginner to total advanced , very messy, if you do not know how to take simple regex, maybe you can read first wiki and tutorials . And manipulation with text, you can check javascript or regex options about it .
 
  • Спасибо
Реакции: zmike
Should it be 5000 to 1? If I want to select the 1st to 5000 characters?
How to preserve a whole sentence?
Example: if a sentence is crossing the 5000th character limit, don't break that sentence but take from the previous full stop?
 
Should it be 5000 to 1? If I want to select the 1st to 5000 characters?
How to preserve a whole sentence?
Example: if a sentence is crossing the 5000th character limit, don't break that sentence but take from the previous full stop?
Should be from 1 to 5000. There is no option to preserver sentence. You should make some regex to cut text and make it end on last sentence.
 
I have got regex code to break the article into full sentence close to 5000 characters, but it may not end at 5000th character.
 
you can with javascript take last character, then check is dot, if not, take 5001 or 4999 and go further .
 
  • Спасибо
Реакции: zmike

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)