-
Jul 19th, 2013, 02:54 AM
#1
Thread Starter
Banned
breaking 1 line of keyword into 5 pieaces
this is involved in (seo) search engine optimization project working with keywords there is 1 thing i need to do breaking 1 line of string into 5 pieces no matter how long or short it should add extra line if short below is example.
string - keyword
hammer jack
results should look like this automatic
hammer jack,hammer,hammer jack 2013,hammer jack 2012,hammer jack 2011
-
Jul 19th, 2013, 01:33 PM
#2
Re: breaking 1 line of keyword into 5 pieaces
I suppose you didn't get any responds because your post wasn't quite clear... so you need to answer some questions and/or provide much more info on your request.
- what does "keyword" mean in your context?
- does your string always contains 2 words?
- do you always require (based on what's posted so far) current year and two prior?
- do you always need to "print" entire string+first word+entire string & cur year+entire string & cur year-1+entire string & cur year-2
- etc, etc, etc...
-
Jul 19th, 2013, 03:35 PM
#3
Re: breaking 1 line of keyword into 5 pieaces
I'm with Rhino....too many possible variables...BUT, if it is exactly as you stated, with no variances, this will populate a second textbox based upon the two words in a first textbox:
Code:
Private Sub Command1_Click()
Dim MyWord() As String
MyWord = Split(Text1.Text, " ")
Text2.Text = Text1.Text & ", " & _
MyWord(0) & ", " & _
Text1.Text & " " & CStr(Year(Now)) & ", " & _
Text1.Text & " " & CStr(Year(Now - 365)) & ", " & _
Text1.Text & " " & CStr(Year(Now - 730))
End Sub
Of course, if you happen to be on 1 Jan, or 31 Dec, and taking into account Leap Years, it might be off a year or two....~smile~
-
Jul 19th, 2013, 06:52 PM
#4
Re: breaking 1 line of keyword into 5 pieaces
Year(Now - 365)
That won't always return correct year:
if it's a leap year and date is Dec 31, 2012 then it will return 2012 - try this: year(cdate("12/31/2012") - 365)
The correct way is [I think]:
year(date) - 1
-
Jul 19th, 2013, 09:43 PM
#5
Re: breaking 1 line of keyword into 5 pieaces
Duh-i always overthink the obvious! Amazing how 2013 minus 1 equals 2012 everytime!!!!!!
-
Jul 19th, 2013, 09:55 PM
#6
Re: breaking 1 line of keyword into 5 pieaces
Originally Posted by SamOscarBrown
Duh-i always overthink the obvious! Amazing how 2013 minus 1 equals 2012 everytime!!!!!!
Yes, the keyword "Year" means that it is dealing in years not days and yet some people still deal in days when that is the case. I am also one of those people.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Jul 19th, 2013, 10:55 PM
#7
Re: breaking 1 line of keyword into 5 pieaces
You need to create a couple loops to desire.
For Example:
Code:
Private Sub Command1_Click()
Dim i As Integer
Dim k As Integer
Dim sText As String
Dim sWords As String
Dim sDelimiter As String
Dim arrText() As String
Dim arrWords() As String
List1.Clear
sText = Text1.Text
sWords = "2011,2012,2013"
sDelimiter = " "
arrText = Split(sText, sDelimiter)
arrWords = Split(sWords, ",")
List1.AddItem sText
For i = 0 To UBound(arrWords)
List1.AddItem sText & " " & arrWords(i)
Next i
If InStr(1, sText, sDelimiter) = 0 Then Exit Sub
For i = 0 To UBound(arrText)
For k = 0 To UBound(arrWords)
List1.AddItem arrText(i) & " " & arrWords(k)
Next k
Next i
For i = 0 To UBound(arrText)
List1.AddItem arrText(i)
Next i
End Sub
Note: To change tag (keywords) simple add/change/remove from the sWords string.
You will need (see picture)
-1 TextBox "Text1"
-1 CommandButton "Command1"
-1 ListBox "List1"
-
Jul 19th, 2013, 11:21 PM
#8
Re: breaking 1 line of keyword into 5 pieaces
Whatcha doing there Max? Are you understanding what OP wants? I'd assume the years could have been 'any' (three???). Not quite sure what you are doing with your code....
-
Jul 19th, 2013, 11:28 PM
#9
Re: breaking 1 line of keyword into 5 pieaces
Originally Posted by SamOscarBrown
Whatcha doing there Max? Are you understanding what OP wants? I'd assume the years could have been 'any' (three???). Not quite sure what you are doing with your code....
Same here! I don't understand why he needs so many for loops?
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Jul 20th, 2013, 10:42 AM
#10
Re: breaking 1 line of keyword into 5 pieaces
I don't even understand why bother posting any code at all - I raised few questions but none of them have been answered so far...
How can you know what OP wants at this point?
-
Jul 20th, 2013, 03:01 PM
#11
Thread Starter
Banned
Re: breaking 1 line of keyword into 5 pieaces
am sorry for late reply guys
keyword means a specific word search engines reconize when you type in google and then google gets all the results showing all websites relating to your keyword you searched for such as , cars,motobikes,planes,tickets, etc and so on.
this is my seo project in html , am sure most of you know how to make websites working with html as you can se below were in the html code showing the line keywords
were you se the keywords tag in the html code below this is the area am working on to make it automated.
<head>
<meta name="description" content="Free Web tutorials">
<meta name=" keywords" content=" visual,basic, basic visual, visual basic, basic visual">
<meta name="author" content="Ståle Refsnes">
<meta charset="UTF-8">
</head>
putting 1 keyword in list1 clicking it on it will generate 5 similar words and placing it to text1,text in this format
list1.text ="motorbikes cheap" ' when clicked it will make split the text also should make unique similar names or randomize it
text1.text ="motorbikes cheap ,cheap motorbikes ,motorbikes cheap 2013,cheap moto,motorbikes"
like this , i no it maybe little hard am close just giving you idea what am trying to do basically splitting 1 keyword and making 5 unique keywords out of it and putting in text1 in that format
anyother example is
main keyword
747 boing < now split this also make 5 more unique names out of it randomizing it too
start of with
747beoing ,boing 747,747 boing 2013,boing,boing 747 2013,boing747"
must have 5 unique words relating to the main word what we typed say boing 747
spaces are allowed within comma
Last edited by ladoo; Jul 20th, 2013 at 03:16 PM.
-
Jul 20th, 2013, 05:32 PM
#12
Re: breaking 1 line of keyword into 5 pieaces
too 'difficult' for me.....unsubscribing.....good luck all.....
-
Jul 20th, 2013, 05:33 PM
#13
Re: breaking 1 line of keyword into 5 pieaces
Did my code give you an idea ladoo? For creating 5 'unique' words, simple use something similar to my code (with more answers if needed) and select random entries from the listbox (or array if you don't need a listbox.
Sorry guys but this one was obvious to know what ladoo was going after , not that he explained properly but he wants like a search engine that will find all similar requests. I don't know what the Date variable/function has to do anything in here.
-
Jul 20th, 2013, 07:07 PM
#14
Thread Starter
Banned
Re: breaking 1 line of keyword into 5 pieaces
il will check it now @ max thanks il figure it out
the date is needed at times when combining keywords
people often search like this
latest cars of 2013
ps4 2013
etc
-
Jul 20th, 2013, 07:19 PM
#15
Re: breaking 1 line of keyword into 5 pieaces
I see, not sure what exactly you have in mind but I know what you are trying to do
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|