Results 1 to 5 of 5
  1. #1
    Join Date
    May 2003
    Posts
    19

    Unanswered: Splitting a string into separate words

    To split a sentence into separate words should be possible with a split function in a query, shouldn't it? I've tried and tried, but without success.

    I have a lot of sentences of up to about 10 words. I need to split them into separate words and put them into separate fields. Has anyone any experience of this please?

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Not within a query no ... Retrieve your sentenca and split it in VB/VBA and then put it in a table ...

  3. #3
    Join Date
    Aug 2003
    Location
    UK
    Posts
    78

    Re: Splitting a string into separate words

    Originally posted by kupe
    To split a sentence into separate words should be possible with a split function in a query, shouldn't it? I've tried and tried, but without success.

    I have a lot of sentences of up to about 10 words. I need to split them into separate words and put them into separate fields. Has anyone any experience of this please?
    Hi
    A word is something that has a space or a non letter/number after it.

    in vb you will need to do something like this:

    for i = 0 to len(sentence)

    myChar= mid(sentence,i,1)

    if myChar = " " then
    'THIS IS A NEW WORD IE THE END OF THE LAST
    'put mystring into your coosen field
    ‘then
    'empty myString
    myString = ""
    ELSE

    myString = mystring & myChar

    end if
    next i



    Sorry if I am teaching you to suck eggs, hope it helps
    the light is on, someone is home, but they dont know they are. HELLO!

  4. #4
    Join Date
    May 2003
    Posts
    19
    Originally posted by M Owen
    Not within a query no ... Retrieve your sentenca and split it in VB/VBA and then put it in a table ...
    Many thanks, M Owen, that helps.

  5. #5
    Join Date
    May 2003
    Posts
    19

    Re: Splitting a string into separate words

    Thanks very much for spelling it all out, dapman2002. No, I'm still pretty new to this amazing world, so the eggs are perfectly prepared, thank you. Gratefully
    Kupe

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •