Page 1 of 1
remove lines containing 1-3 digits, - and . only
Posted: Wed Feb 03, 2016 6:31 am
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.
Re: remove lines containing 1-3 digits, - and . only
Posted: Wed Feb 03, 2016 6:04 pm
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
Re: remove lines containing 1-3 digits, - and . only
Posted: Thu Feb 04, 2016 3:05 am
by Glenn
Thank you very much,
I'll try it soon and let you know.
Regards.
Re: remove lines containing 1-3 digits, - and . only
Posted: Sun Feb 07, 2016 10:00 am
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.
Re: remove lines containing 1-3 digits, - and . only
Posted: Sun Feb 07, 2016 1:59 pm
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!
Re: remove lines containing 1-3 digits, - and . only
Posted: Sun Feb 07, 2016 1:59 pm
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!
Re: remove lines containing 1-3 digits, - and . only
Posted: Sun Feb 07, 2016 9:02 pm
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.
Re: remove lines containing 1-3 digits, - and . only
Posted: Sun Feb 07, 2016 9:38 pm
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.
Re: remove lines containing 1-3 digits, - and . only
Posted: Tue Feb 09, 2016 1:21 pm
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!