Page 1 of 1

Erasing lines with more than 7 characters

Posted: Tue Oct 05, 2010 7:29 am
by Devin
I'm not even sure if textcrawler can do this but if so, that would be excellent.

Basically I have a .txt file with 1,000's of urls that have a .bz extension. I'm tryin to get rid of the ones that have more than 6 characters including the period(.)

So for example say i have this in my text file:

horse123.bz
googlef2.bz
h1k.bz
213.bz

I want to filter it out and only keep the h1k.bz and 213.bz anything over the 6 characters would be filtered out.

Is it possible to do this with text crawler? If not, is there anything out there that can do this for me?

Thanks,
Devin

Posted: Tue Oct 05, 2010 8:59 am
by DV
This will find any of the files with 6-100 characters and a .bz extension

In regex mode:
[a-zA-Z0-9_-]{6,100}.bz

To delete, you run a replace with nothing.

Posted: Tue Oct 05, 2010 6:36 pm
by Devin
Are you sure that is correct? I put that in the regex mode and it seemed to delete all the ones i needed and kept everything over 6 characters.

thanks for the help

Posted: Tue Oct 05, 2010 6:45 pm
by Devin
Ok I got it working with the info you provided, I was just making a mistake when entering it.

So i tried it and i have a text with over 30,000 lines but when i filter out all the domains i dont want i end up with a bunch of blank spaces in between the lines that i do want so i have to scroll down the list a long time. Is there any way to get rid of the blank lines and bring them close together?

Thanks again

Posted: Tue Oct 05, 2010 6:50 pm
by Devin
Nevermind I figured it out using the scratch pad! Woo hoo this program rocks! thanks for the help

Posted: Tue Oct 05, 2010 9:13 pm
by Fool4UAnyway
You might as well look for the URL's you want to keep and use the Extract button.

If you want the file itself to be updated immediately, you may just include the line ending \r\n in the regular expression. The line itself will be removed as well, then.