prefix and suffix 2 lists of words.

Hey guys, I haven't done any programming since school and seem to have forgotten quite a lot since then 4+ years or so.

My cousin has asked me to do some SEO for his hardware store, so I have a list of sample keywords, "door handles", "hinges" etc. But I want to combine every combination with another list of 'buying' keywords.

I'm thinking this is probably easier to do in Bash than C, what do you think?

1
2
3
4
  - create 3 arrays
  - open both files and copy each to the 2 arrays
  - for each line in array 1 { for each line in array 2 # combine strings and store in array 3
  - output array 3 into file.


Is that pretty much how the code will go?
I can lookup code easy enough I guess it's more the pseudocode I need help with.
But I want to combine every combination with another list of 'buying' keywords.


I don't understand this. From what I read, this is all you need:
1
2
3
4
5
6
~$ cat products
door
handle
~$ awk '{ printf "my prefix %s\n", $1 }'  < products
my prefix door
my prefix handle


btw, this should be in the "UNIX/LINUX" thread. ...Or maybe my answer is responsible for that.
Last edited on
The only problem with that is I'd still have to type all the keywords out at least for 1 of the files yeah?

I'm thinking I might just go through all my old school work until I can create an actual program out of this that will take arguments, therefore a reusable code sample.

I know way back when, I created a nifty database for a shop/commerce store. Worked really well, and all in Bash sh.

It's kind of similar so should be a good resource "if I can find it".

Otherwise I'll just have to do basic code and type out each keyword in two array declarations then create 2 more arrays, 1 suffixed list and 1 prefixed list and just copy/paste the output to save stuffing around.

Stick it all in Google Keyword tool to find the best keywords to target.
Last edited on
Topic archived. No new replies allowed.