It looks like you're using an Ad Blocker.

Please white-list or disable in your ad-blocking tool.

Thank you.


Some features of ATS will be disabled while you continue to use an ad-blocker.


Searching for script or applet.

page: 1

log in


posted on Jan, 4 2012 @ 04:26 PM
I am trying to find a script that I can run on my computer that will perform the following task:

It will look at a list of words and then tell me which words contain a certain string of letters. The string of letters need not be in a particular order. Example: The script will scan a list of names and tell me which names contain all of the letters e g and d in any order or sequence, even if the individual letters are separated by intervening letters.

Any suggestions would be appreciated.
edit on 4-1-2012 by ipsedixit because: (no reason given)

posted on Jan, 4 2012 @ 04:41 PM

Seriously though, I used to have a script (two actually, but one is in php and is server based)

Both sit in one of quite a few external drives I have laying around. If I find them, I will share with you.

posted on Jan, 4 2012 @ 05:13 PM
reply to post by azbowhunter

Thanks for the response and for the effort.

If I were ambitious and intelligent I would try to write one myself. I know there are archives of scripts here and there on the web and I might try to search them for what I want, but if someone had already been down that road before me it would be simpler/quicker.

posted on Jan, 4 2012 @ 10:55 PM
There are many "GREP" programs, none will do a search
involving "string of letters need not be in a particular order."

I don't know of any program or script that will do that.

A program that might come close in the sense of partial
"hit" is dnGrep.

posted on Jan, 4 2012 @ 11:40 PM
reply to post by fever

Thanks. I'll look into it.

posted on Jan, 5 2012 @ 12:48 AM
reply to post by fever

I checked out dnGrep. It will do enough of the job to help me out. Thanks for the suggestion.

posted on Jan, 8 2012 @ 08:03 PM
I wanted to refine my opening post a little. In looking for an answer I found that the "Find" and "Replace" functions in a word processor that allow one to do batch corrections of spelling errors, etc., are useful for my purposes, but I was wondering if there was either a program or script that would recursively "find and replace" a series of letters in a list of words, without having to perform the operation separately for each letter sought.

Any suggestions on this approach would be appreciated.

posted on Jan, 13 2012 @ 04:09 AM
reply to post by ipsedixit

I would use "sed" for that, say i had a file called "names" containing a list of names and wanted to replace all occurrences of dave for david i would run;

sed -i 's/dave/david/g' names

If you wanted to change multiple characters/strings at once the easiest way would be;

sed -i 's/orange/apple/g; s/salt/vinegar/g' shoppinglist.txt

the trailing "g" on the pattern matching tells sed to replace every occurence.

This would be the easiest way to do it on linux/mac/unix, You can however get sed for windows with this download;

Be warned it is a command line tool, i'm not aware of any graphical frontend for it. But it does the job quick and easy.
edit on 13/1/2012 by InsideYourMind because: (no reason given)

edit on 13/1/2012 by InsideYourMind because: (no reason given)

posted on Jan, 15 2012 @ 04:24 PM
reply to post by InsideYourMind

Thanks for the information. I'll give it a try.

The simple "Replace" function in Notepad does what I want if I enter each letter I want replaced in turn. It is the easiest graphical interface for performing this operation that I have found, but it will only work with one discrete letter at a time. Ideally I would be able to enter a number of letters, have the program treat each one as a discrete letter and do the lot at once, replacing them all, regardless of their order or whether they appear together or separately in a word.

posted on Jan, 15 2012 @ 05:28 PM
I downloaded and installed sed.

I'm having some teething problems with it. I tried your example code substituting David for Dave but sed couldn't find the document "names.txt" (saved to the Desktop.)

It looks like sed should do the job. I don't have time at the moment, but it looks as if I will have to work out what I am doing wrong and try again.

Thanks for the info though. sed looks intriguing.

new topics

top topics


log in