How to delete empty lines from txt file ?

intruder2600

Client
Регистрация
15.12.2011
Сообщения
47
Благодарностей
1
Баллы
6
Hi,

I have a txt file like this:

first word

second worrds and some other text


Some other lines
Rest of txt
At the beginning of the file there are some empty lines (not always) and some more empty lines are in txt and at the end of it. How can I dele this empty lines to make it look like this ? :

first word
second worrds and some other text
Some other lines
Rest of txt
Thank you :-)
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
{-RegExp.Replace-|-YOUR BLOCK OF TEXT HERE-|-{-String.Enter-}{-String.Enter-}-|-{-String.Enter-}-}
 

intruder2600

Client
Регистрация
15.12.2011
Сообщения
47
Благодарностей
1
Баллы
6
Thanks alot, but I can't figure it out, I've made a first step:

{-File.GetBlock-|-C:\patch\article\.txt-|--|-random-|-false-}

And then

{-RegExp.Replace-|-{-FieldData.FieldData-|-●5●1●7●3●8●9●-|-≡4≡9≡4≡6≡8≡0≡4≡2≡6≡-}-|-{-String.Enter-}{-String.Enter-}-|-{-String.Enter-}-}

But it didn't remove empty lines.
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
  • Спасибо
Реакции: neomatic и intruder2600

intruder2600

Client
Регистрация
15.12.2011
Сообщения
47
Благодарностей
1
Баллы
6
Thank you very, very much ! That's what I needed :-)
 

reislet

Client
Регистрация
02.04.2012
Сообщения
33
Благодарностей
1
Баллы
0
Something is odd with this, I don't think it's the code.

In my case this is what's happening

Код:
url1
url2

url3
url4


url5
When i parse it with regex the file looks like this in read mode (total commander)
Код:
url1

url2

url3

url4

url5
In write mode is perfect, but if i want to get the count of strings i zenno is using read mode so the number is off :(
Any ideas why?

I get the text as a block and delete is setting the last parameter to true, then I parse and save to the same file.
 

reislet

Client
Регистрация
02.04.2012
Сообщения
33
Благодарностей
1
Баллы
0
So I used a dirty method to get rid of those lines.
Read every line and compare, if it's empty then move to the next line, if not save it in a new text file
 

neomatic

Client
Регистрация
27.10.2011
Сообщения
64
Благодарностей
8
Баллы
8
@rostonix
Very nice solution test.xml, thanks for sharing.
But when recording in a file, the break lines appear again.
Do you know a way to remove it in the file, without a dirty method as explained by resilet ?
 

neomatic

Client
Регистрация
27.10.2011
Сообщения
64
Благодарностей
8
Баллы
8
@rostonix
Sorry, it 's actually working with {-RegExp.Replace-|-YOUR BLOCK OF TEXT HERE-|-{-String.Enter-}{-String.Enter-}-|-{-String.Enter-}-}
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113

neomatic

Client
Регистрация
27.10.2011
Сообщения
64
Благодарностей
8
Баллы
8
Unfortunately I have ZP3. But MP looks impressive !
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
Suggest you to update. Zp3 is totally outdated.
 

neomatic

Client
Регистрация
27.10.2011
Сообщения
64
Благодарностей
8
Баллы
8
Yep, I know, I'm just getting in ZennoPoster3 after let it on the side for several months. I rather be familiar with the soft before to update.
As customer, is there a discount advantage to upgrade from a previous version or do I need to pay as a new customer ?
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113

neomatic

Client
Регистрация
27.10.2011
Сообщения
64
Благодарностей
8
Баллы
8
ho ok. 6 months upgrade is including complete new version upgrade I assume. Thank you for your answer.
 

neomatic

Client
Регистрация
27.10.2011
Сообщения
64
Благодарностей
8
Баллы
8
Upgraded since a month, and I love it !
 
  • Спасибо
Реакции: rostonix и bigcajones

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