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

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

Glenn
Posts: 9
Joined: Wed Jan 23, 2013 8:54 pm

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

Postby Glenn » Wed Feb 03, 2016 6:31 am

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: 2154
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

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

Postby DataMystic Support » Wed Feb 03, 2016 6:04 pm

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, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

Glenn
Posts: 9
Joined: Wed Jan 23, 2013 8:54 pm

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

Postby Glenn » Thu Feb 04, 2016 3:05 am

Thank you very much,

I'll try it soon and let you know.

Regards.

Glenn
Posts: 9
Joined: Wed Jan 23, 2013 8:54 pm

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

Postby Glenn » Sun Feb 07, 2016 10:00 am

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: 2154
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

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

Postby DataMystic Support » Sun Feb 07, 2016 1:59 pm

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, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

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

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

Postby DataMystic Support » Sun Feb 07, 2016 1:59 pm

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, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

Glenn
Posts: 9
Joined: Wed Jan 23, 2013 8:54 pm

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

Postby Glenn » Sun Feb 07, 2016 9:02 pm

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: 9
Joined: Wed Jan 23, 2013 8:54 pm

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

Postby Glenn » Sun Feb 07, 2016 9:38 pm

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: 2154
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

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

Postby DataMystic Support » Tue Feb 09, 2016 1:21 pm

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, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: No registered users and 3 guests