How to split text file by 5000 characters?

zmike

Client
Регистрация
24.10.2019
Сообщения
155
Благодарностей
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.
 

aleksa77

Client
Регистрация
30.09.2011
Сообщения
914
Благодарностей
90
Баллы
28
regex

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

zmike

Client
Регистрация
24.10.2019
Сообщения
155
Благодарностей
10
Баллы
18

zmike

Client
Регистрация
24.10.2019
Сообщения
155
Благодарностей
10
Баллы
18
How can I get the first 5000 characters, then the second, third and fourth (if any)

I can only get the first match

 

aleksa77

Client
Регистрация
30.09.2011
Сообщения
914
Благодарностей
90
Баллы
28
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

Client
Регистрация
24.10.2019
Сообщения
155
Благодарностей
10
Баллы
18
Ok thanks,
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 737
Благодарностей
5 998
Баллы
113
  • Спасибо
Реакции: zmike

zmike

Client
Регистрация
24.10.2019
Сообщения
155
Благодарностей
10
Баллы
18
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?
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 737
Благодарностей
5 998
Баллы
113
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.
 

zmike

Client
Регистрация
24.10.2019
Сообщения
155
Благодарностей
10
Баллы
18
I have got regex code to break the article into full sentence close to 5000 characters, but it may not end at 5000th character.
 

aleksa77

Client
Регистрация
30.09.2011
Сообщения
914
Благодарностей
90
Баллы
28
you can with javascript take last character, then check is dot, if not, take 5001 or 4999 and go further .
 
  • Спасибо
Реакции: zmike

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