Merge Several Lines Into 1 w/no duplicate words

SavatageSavatage Member Posts: 7,142
Before I start on this I would like if anyone has any thoughts or if they've tryed it already.

What we are trying to do is (for example) take an item description.
1)HARRY HAIR CREME
2)HARRY HAIR GEL
3)HARRY FOOT CREME

Get a Result Like
HARRY HAIR CREME GEL FOOT

Where is took every word from the description and if it already existed then skip the word, if it's a new word add the word. Trying to create a type of meta tag for HARRY BRAND. I'm thinking finding the SPACE as a cut off point & starting point

Possible - Too Hard - NO WAY! any thoughts appreciated.

Comments

  • garakgarak Member Posts: 3,263
    Hi Harry,

    thats no problem (some costs of hours and "mind lard"), but what is with delimiter like _ or / or - instead of space?
    Is Harry-Ice-Cream one word or 3? And where you want to store the meta tags? a separate field with how many bytes? Or in a table ?

    Regards
    Do you make it right, it works too!
  • Alex_ChowAlex_Chow Member Posts: 5,063
    Here's what I would do without doing too much programming:
    1. Create a new table with 1 Code field and set it as primary key
    2. Go through the streen and use STRPOS to find blank spaces, use COPYSTR to insert the values into the new table
    3. When the looping is done and the values are inserted into the table, loop the new table and concatenate it into a string
    4. Delete the table and repeat the process

    Hope you get my drift. :D
  • SavatageSavatage Member Posts: 7,142
    there are no dashes - every word is seperated by a space.

    I guess I would create a new field called metatag size 250 text.

    Hmm perhaps a new table Field 1 would be item number & key
    then 50 other fields each field a different tag?
    tag1
    tag2
    tag3
    .
    .
    tag50

    I guess 50 words :-k max would be enuf.??
    which do you think would be easier???
  • garakgarak Member Posts: 3,263
    or two tables (only afast idea).

    Table one Wordindex (is filled with every founded existing word)

    ID (autoincr.) (PK)
    Word (text 30) (FK)

    Table 2 (Tags)

    Code 250 (PK) <- This you fill with (used as filter) ID|ID|ID and so on.

    So you can also filter to know which Tags exist.

    Your Item Descriptions
    1)HARRY HAIR CREME
    2)HARRY HAIR GEL
    3)HARRY FOOT CREME
    4)OTTO
    5)THE FILM
    6)FILM BEST OF

    Table Wordindex:

    1 Harry
    2 Hair
    3 Creme
    4 Gel
    5 Foot
    6 OTTO
    7 THE
    8 FILM
    9 BEST
    10 OF

    Table Tags
    1|2|3|4|5
    6
    7|8|9|10

    Is this what you want?
    Do you make it right, it works too!
  • SavatageSavatage Member Posts: 7,142
    sounds like a good place to start.
  • garakgarak Member Posts: 3,263
    and for what do you need this?
    Create dynamic metatags for your website?
    Do you make it right, it works too!
  • SavatageSavatage Member Posts: 7,142
    That was the request to help people find what they're looking for by brand. I haven't googled to see if there is some tool out there already that does this...paste a bunch of text and it pulls out key words.. :-k
  • Alex_ChowAlex_Chow Member Posts: 5,063
    I think what you're talking about may be accomplished using Sharepoint. It's basically a intracompany seach engine.
  • SavatageSavatage Member Posts: 7,142
    Not familiar with Sharepoint - thou I probably have a copy lying around on one of these 1000's of technet cd's.

    Perhaps this weekend I'll have some time to check it out. I see the sharepoint website has some demos's too.
  • Alex_ChowAlex_Chow Member Posts: 5,063
    Yeah, check that out. Let us know if it's what you need. That should save you some headaching development time. :D
  • TonyHTonyH Member Posts: 223
    I've never used them, but could Regular Expressions help you with this? Its implemented in the .Net Framework, and you could call some sort of assembly on a SQL backend using Ado.net....

    As to how to do that not 100% sure, but regular expressions are all about "identifying strings of text of interest, such as particular characters, words, or patterns of characters"

    ??

    Just a 2 pence input, I am sure there are people on here that know more about it than I do.

    t
  • David_SingletonDavid_Singleton Member Posts: 5,479
    There was an Add-On for Navision called Navi Marketing. Eventually it became what we now know as NAV CRM.

    It had a function that did exactly this. I am pretty sure the function was kept in the early versions but then was removed. find an older version of Navision and pull the code from there. I think it might be in 2.01.

    By the way it was used for two things, one was as a search tool, but more important as a duplicate clean up tool.
    David Singleton
Sign In or Register to comment.