Results 1 to 15 of 15

Thread: breaking 1 line of keyword into 5 pieaces

  1. #1

    Thread Starter
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    Thumbs up 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

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    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...

  3. #3
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,176

    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~

  4. #4
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    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

  5. #5
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,176

    Re: breaking 1 line of keyword into 5 pieaces

    Duh-i always overthink the obvious! Amazing how 2013 minus 1 equals 2012 everytime!!!!!!

  6. #6
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: breaking 1 line of keyword into 5 pieaces

    Quote Originally Posted by SamOscarBrown View Post
    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

  7. #7
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    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"

    Name:  form.jpg
Views: 119
Size:  117.5 KB

  8. #8
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,176

    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....

  9. #9
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: breaking 1 line of keyword into 5 pieaces

    Quote Originally Posted by SamOscarBrown View Post
    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

  10. #10

  11. #11

    Thread Starter
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    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.

  12. #12
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,176

    Re: breaking 1 line of keyword into 5 pieaces

    too 'difficult' for me.....unsubscribing.....good luck all.....

  13. #13
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    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.

  14. #14

    Thread Starter
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    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

  15. #15
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    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
  •  



Click Here to Expand Forum to Full Width