remove lines containing 1-3 digits, - and . only

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
Glenn
Posts: 10
Joined: Wed Jan 23, 2013 8:54 pm

remove lines containing 1-3 digits, - and . only

Post by Glenn »

Hi, can you please tell me how to remove lines from a text file that are 1 to 3,- or . ONLY using easypattern please?

For example, if the text file contained:

1red
123green
1
190blue
23
001z
989
a112
1-2
45.5
green1.1
1.0
11.0
22-9
454.-
1-orange
1.014
1 green
1.0 blue
123 aa
a123
aa 123
111.
111.yellow
111 yellow
1d
24.2
999.0
67-8
-68.

After removing it would look like:

1red
123green
190blue
001z
a112
green1.1
1-orange
1.014
1 green
1.0 blue
123 aa
a123
aa 123
111.yellow
111 yellow
1d
999.0

Thank you,

Glenn.
User avatar
DataMystic Support
Site Admin
Posts: 2229
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: remove lines containing 1-3 digits, - and . only

Post by DataMystic Support »

Ok, use Filters\Remove\Remove lines\Remove matching lines

with a pattern of

Code: Select all

[ lineStart, 1+ (digits or period or hyphen or comma), lineEnd ]
If you also want to keep lines with 999.0 then you'll need to mark them in another way first.

Let me know if you need help with that
Regards,

Simon Carter, https://www.DataMystic.com
https://www.JadeDiabetes.com - Insulin dose calculator for Type 1 diabetes
https://www.DownloadPipe.com - 250,000 free software downloads
Glenn
Posts: 10
Joined: Wed Jan 23, 2013 8:54 pm

Re: remove lines containing 1-3 digits, - and . only

Post by Glenn »

Thank you very much,

I'll try it soon and let you know.

Regards.
Glenn
Posts: 10
Joined: Wed Jan 23, 2013 8:54 pm

Re: remove lines containing 1-3 digits, - and . only

Post by Glenn »

Hi again,

I tried adding the filter as you suggested, but the lines I am trying to remove are still there.
Anything else you can think of I could try please?

Thank you.
User avatar
DataMystic Support
Site Admin
Posts: 2229
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: remove lines containing 1-3 digits, - and . only

Post by DataMystic Support »

Please email me the filter you designed and I can check it for you. Sorry - 14 minutes of battery life left in an airport lounge - can't do it for you!
Regards,

Simon Carter, https://www.DataMystic.com
https://www.JadeDiabetes.com - Insulin dose calculator for Type 1 diabetes
https://www.DownloadPipe.com - 250,000 free software downloads
User avatar
DataMystic Support
Site Admin
Posts: 2229
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: remove lines containing 1-3 digits, - and . only

Post by DataMystic Support »

Please email me the filter you designed and I can check it for you. Sorry - 14 minutes of battery life left in an airport lounge - can't do it for you!
Regards,

Simon Carter, https://www.DataMystic.com
https://www.JadeDiabetes.com - Insulin dose calculator for Type 1 diabetes
https://www.DownloadPipe.com - 250,000 free software downloads
Glenn
Posts: 10
Joined: Wed Jan 23, 2013 8:54 pm

Re: remove lines containing 1-3 digits, - and . only

Post by Glenn »

Hi,

I appreciate you taking the time whilst in an airport lounge, amazing!

I was disabling filters from my filter list ready to send you (I have one filter list and enable/disable filters as I need) and thought I'd give it one more run before sending it - and it worked fine. Sorry for confusion.

When you have time (not necessarily mid flight, hehe), could you tell me whether it is possible to put a character limit of say 5 on the filter? So any lines containing more than 5 characters are NOT removed (even if the line consists of just numbers, periods, hyphens and commas).

Thank you so much.
Glenn
Posts: 10
Joined: Wed Jan 23, 2013 8:54 pm

Re: remove lines containing 1-3 digits, - and . only

Post by Glenn »

Hi again,

Please ignore the above, I think I've done it:

Code: Select all

[ lineStart, 1-4 (digits or period or hyphen or comma or space), lineEnd ]
Seems to be working for me.

Thanks you so much again for your help.

Regards.
User avatar
DataMystic Support
Site Admin
Posts: 2229
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: remove lines containing 1-3 digits, - and . only

Post by DataMystic Support »

Hi Glenn - no problem at all! It was a 23 hour flight, and Emirates wifi during the flight was a bit slow. Although the fact that they had wifi at all was pretty amazing!
Regards,

Simon Carter, https://www.DataMystic.com
https://www.JadeDiabetes.com - Insulin dose calculator for Type 1 diabetes
https://www.DownloadPipe.com - 250,000 free software downloads
Post Reply