Anagram finder based in Ascii values


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Anagram finder based in Ascii values
# 1  
Old 10-31-2014
Anagram finder based in Ascii values

Hello, i need some help with a programm i want to make, what i want to do is to make a dictionary and include some anagrams with it, and make the programm read the Ascii value of each word, and compare them with the anagrams and make the programm print the words that have the same Ascii value, meaning that the words are the original and the anagram of it Smilie It's not a homework, i just wanted to try making a programm using the Ascci values.

Here are the words i have:
Code:
Words                             Anagrams

carro			:	abenlnela
lupa			        :	maraca
computadora		:	elico
agenda			:	saca
ubuntu			:	lorba
casa			        :	bleca
documento		:	pich
windows			:	sema
alumno			:	potal
manzana			:	adiservinud
arbol
pizarron
cielo
ventana
casillero
poster
aire
plaza
tienda
cable
tarea
chip
disco
pantalla
mouse
velcro
mueble
silla
mesa
sillon
plato
cocina
comida
cabello
ejercicio
azul
sol
tierra
universidad
sony
internet
guardar
madera
xbox
celular
mano
lentes
annabelle
camara
android

Please it would be of such help to tell me how i could do it

Moderator's Comments:
Mod Comment Please wrap all code, files, input & output/errors in CODE tags
As you can see from the change I have made, the columns and
white-space separations are respected making it far easier to read.

Last edited by rbatte1; 11-03-2014 at 10:42 AM.. Reason: Added CODE tags
# 2  
Old 10-31-2014
You appear to want awk or bash, but I think a language like perl which at least has data structures would be appropriate -- since I would want to solve this with a tree.

Though I suppose awk can emulate a tree, if you try hard enough, by cramming enough elements into the array index, though it wouldn't be efficient.

What languages do you have available?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert Hex to Ascii in a Ascii file

Hi All, I have an ascii file in which few columns are having hex values which i need to convert into ascii. Kindly suggest me what command can be used in unix shell scripting? Thanks in Advance (2 Replies)
Discussion started by: HemaV
2 Replies

2. Shell Programming and Scripting

Replace alphabets in a string with their ASCII values

hi. I have a requirement where I need to REPLACE all alphabets from an alphanumeric input string into their respective ASCII decimal value. For example: If the input string is ABAC123, the output should be 65666567123 I am seeking a single line command, and I was trying searching for options... (21 Replies)
Discussion started by: kumarjt
21 Replies

3. UNIX for Beginners Questions & Answers

Convert ascii character values to number that comes between the numbers in UNIX

I have variable that contains multiple values of number and also include overpunch(i.e. # $ % etc) character so we want to replace it with numbers. here are the example: Code: 11500#.0# 28575$.5$ 527#.7# 42".2" 2794 .4 2279!.9! 1067&.7& 926#.6# 2279!.9! 885".5" 11714$.4$ 27361'.1'... (1 Reply)
Discussion started by: nadeemrafikhan
1 Replies

4. UNIX for Dummies Questions & Answers

sum values based on ID

Hi, I would like to be able to sum up the counts of a column by the ID of another column. Example (although the actual file I have has thousands of IDs): Input file: A1BG-AS1:001 3 A1BG-AS1:002 0 A1BG-AS1:003 2 A1CF:001 1038 A1CF:002 105 A1CF:003 115 A1CF:004 137 Desired output... (3 Replies)
Discussion started by: fadista
3 Replies

5. Shell Programming and Scripting

Incrementing ascii values

Hi All, I require some help with the below: I am trying to incriment the ascii value of a letter and then print it. So basically "a" becomes "b" and "z" becomes "A". Does anyone have any pointers? Cheers, Parks (10 Replies)
Discussion started by: bParks
10 Replies

6. Shell Programming and Scripting

How to pick values from column based on key values by usin AWK

Dear Guyz:) I have 2 different input files like this. I would like to pick the values or letters from the inputfile2 based on inputfile1 keys (A,F,N,X,Z). I have done similar task by using awk but in that case the inputfiles are similar like in inputfile2 (all keys in 1st column and values in... (16 Replies)
Discussion started by: repinementer
16 Replies

7. Shell Programming and Scripting

A little help using grep for anagram solving with BASH

Hi guys, I have been making a simple script for looking for anagram solutions in a word list (a file of 22k or so words). At the moment it funtions like so: User enters an 8 character string (whatever letters you want to find anagrams of, or solve rather) The script moves all the words... (2 Replies)
Discussion started by: Donthommo
2 Replies

8. Shell Programming and Scripting

convert ascii values into ascii characters

Hi gurus, I have a file in unix with ascii values. I need to convert all the ascii values in the file to ascii characters. File contains nearly 20000 records with ascii values. (10 Replies)
Discussion started by: sandeeppvk
10 Replies

9. UNIX for Advanced & Expert Users

Converting Binary decimal coded values to Ascii Values

Hi All, Is there any command which can convert binary decimal coded values to ascii values... i have bcd values like below оооооооооооо0о-- -v - Pls suggest a way to convert this. Thanks, Deepti.Gaur (3 Replies)
Discussion started by: gaur.deepti
3 Replies

10. UNIX for Dummies Questions & Answers

grep using ASCII values

machine: HPUX file: a.dat contents: decimal 1 decimal 2 string 1 string 2 ASCII value of 'd': 100. to grep lines that have 'd', I use the following command grep d a.dat My requirement: I should grep for lines that contain 'd'. But I should use ASCII value of 'd' in the command... (1 Reply)
Discussion started by: sriksama
1 Replies
Login or Register to Ask a Question