Page 1 of 1

I'm guessing even Textpipe cannot do this.

Posted: Sat Nov 10, 2007 1:59 pm
by ezinestein
Hi,

I'll guess that there is no way to achieve this using textpipe, but I'll ask anyway.

I would like to clean a text file of all lines that contain alphabetized phrases.

For example:

a new business adventure
a cat chases mice
I like sandwiches
the dog eats grass

In the above example, lines 2 and 3 are what I'm calling 'alphabetized'. This is because the first letter in each word goes in alphabetical order.

Like 'a cat chases mice'. In that example the first letters of each word go like this 'a,ca,ch m'.

The 'I like sandwiches example goes like this 'i,l,s'.

In each case the initial letters of the word go in alphabetical sequence.

I would love for textpipe to filter out or remove such lines?

Is this at all possible?

Best,
ez

Posted: Fri Nov 16, 2007 12:37 pm
by DataMystic Support
Ahh -why?

Posted: Sat Nov 17, 2007 8:34 am
by ezinestein
Thank you for your response.

I know it may seem like a strange request... but it would take too long for me to explain why I'd like it done.

That said... any chance that I might be able to accomplish this with textpipe?

Thanks again,
ez

Posted: Mon Nov 19, 2007 7:02 am
by DataMystic Support
Yes - it sounds like a student project!

It can be done by copying each line into 2 columns, then sorting the 2nd column to get the words in alphabetical order, and then comparing the 1st and 2nd columns.

Posted: Mon Nov 19, 2007 12:22 pm
by ezinestein
Thanks again for the response.

I can't seem to wrap my mind around what you're saying... as I can't figure out how textpipe will alphabetize the words in a line. Alphabetize lines, yes... but the words in a single line?

I feel dense... and all without being a student too. lol

Thanks again if you're willing to help me understand what you meant in your last post.

Best,
ez

Posted: Mon Nov 19, 2007 12:57 pm
by DataMystic Support
Inside the 2nd column, convert the words to a word list (which puts them one per line), then sort this, then replace line feeds with spaces to return the line to a sentence form.