[SOLVED] Generate SPECIAL alphanumeric WORDLIST - no repeating characters side-by-side
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
First of all, I hope you realize that to send to a file all 10-character combinations of the following characters
Code:
0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
such that no two adjacent characters are of equal value, and placing each combination on its own line, will generate a file that's 31 petabytes long. I hope you have room for this.
The program listed below will generate that file. Just redirect standard output to a file in the normal manner.
No, I haven't tested it to completion. But you can test a crippled version of it by doing these four things:
Comment out the first definition of *character-set*, by adding a semicon at the beginning of the line.
Uncomment the second definition, which just uses "ABC", by removing the semicolon from the beginning of the line.
Comment out the first definition of *word-length*.
Uncomment the second definition, which uses a word length of four.
If you do that and run the program, you'll get this output. That's the kind of output you're looking for, right?
hoping i can find some help here but first wanted to say thanks for the bash and awk scripts guys. handy code
im trying to mod this scrit to put a-z upper and lower case in front of each word in my list.
this is what i've been using to put numbers 1-9999 at the end
It was easy to adapt this clever grep to read a long list of English words and keep only those which contain one or more letter pairs (such as the word letter).
Code:
grep -E '(.)\1' < $InFile > $Work02
Now I want to extend the theme to keep only those words which contain two or more letter pairs (such as the word success). I tried this ...
... and (2) build a list of all words with three consecutive letter pairs (such as the word bookkeeper).
Code:
egrep '(.)\1+(.)\2+(.)\3+' < $InFile > $Work05
On what basis does technical intuition guide you toward egrep rather than grep?
Daniel B. Martin
The "<" in the command is both unnecessary and a waste of resources. grep reads all arguments after the first one (the regular expression) as input file names.
egrep is just a standard alias for grep -e
Last edited by PTrenholme; 02-13-2012 at 10:51 AM.
Reason: Unneeded comments deleted.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.