Seperating data from single table field (string)

Ask a Question related to ASP, Design and Development.

  1. #1

    Default Seperating data from single table field (string)

    Hi All

    Can anyone help with this please.

    I need a way of putting say 10 to 20 bullet points in one table field in an
    Access database
    - say seperate them with a special character, then build a bulletted list on
    my page.

    If I can get the page to detect each special character, insert a new bullet
    and move on to the next occurance in the string...

    e.g. point01%point02%point03%point04%point05%point06

    to...

    <ul>
    <li>point01</li>
    <li>point02</li>
    <li>point03</li>
    <li>point04</li>
    <li>point05</li>
    <li>point06</li>
    </ul>

    Many thanks in advance

    vool


    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    Version: 6.0.509 / Virus Database: 306 - Release Date: 12/08/2003


    vool Guest

  2. Similar Questions and Discussions

    1. Parse a string from a field and display in table
      Hi, I am new to ASP but have what should be a fairly simple task that I can't figure out. I need to parse a string from a single, semi-colon...
    2. Seperating data within a field
      Hi All, I am designing a website for a tennis club. Each week Tennis Australia release an excel spreadsheet of last weekend's results. I import...
    3. ASP Code to generate the schema of an SQL Table (field name, Data types , Size)
      Anyone has this SQL STATEMENT to traverse the User defined tables? I just need the Select Statement to get this info the rest I can handle. I...
    4. #25473 [NEW]: Updating single row in table causing all rows in table to be updated.
      From: jim at bluedojo dot com Operating system: WinXP PHP version: 4.3.3 PHP Bug Type: MySQL related Bug description: ...
    5. Select from table where field = string
      How to select all lines containg a string (located in $pastmove) in the moves column I tried several ways, for example: $requete="SELECT...
  3. #2

    Default Re: Seperating data from single table field (string)

    Just store the terms as a comma separated list (or use a more robust
    placeholder if commas are likely to appear in any term). When you retrieve
    this string from the database split it on the placeholder, which generates
    an array, and iterate through creating your HTML:

    MyStringTerm = RS.Fields("MyString") ' contains "alpha,bravo,charlie"
    MyStringArray = Split (MyStringTerm, ",") ' contains
    ("alpha","bravo","charlie")
    Response.Write "<ul>"
    For Each Term In MyStringArray
    Response.Write "<li>"
    Response.Write Term
    Response.Write "</li>"
    Next
    Response.Write "</ul>"

    Alan

    "vool" <vool@fsnet.com> wrote in message
    news:eHV4tswYDHA.2032@TK2MSFTNGP10.phx.gbl...
    > Hi All
    >
    > Can anyone help with this please.
    >
    > I need a way of putting say 10 to 20 bullet points in one table field in
    an
    > Access database
    > - say seperate them with a special character, then build a bulletted list
    on
    > my page.
    >
    > If I can get the page to detect each special character, insert a new
    bullet
    > and move on to the next occurance in the string...
    >
    > e.g. point01%point02%point03%point04%point05%point06
    >
    > to...
    >
    > <ul>
    > <li>point01</li>
    > <li>point02</li>
    > <li>point03</li>
    > <li>point04</li>
    > <li>point05</li>
    > <li>point06</li>
    > </ul>
    >
    > Many thanks in advance
    >
    > vool
    >
    >
    > ---
    > Outgoing mail is certified Virus Free.
    > Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    > Version: 6.0.509 / Virus Database: 306 - Release Date: 12/08/2003
    >
    >

    Alan Guest

  4. #3

    Default Re: Seperating data from single table field (string)

    Wow that was fast, thanks Alan, that'll do the trick


    "Alan" <SPAMMENOTalan.howard@inspire.net.nz> wrote in message
    news:#1Hma3wYDHA.2464@TK2MSFTNGP09.phx.gbl...
    > Just store the terms as a comma separated list (or use a more robust
    > placeholder if commas are likely to appear in any term). When you retrieve
    > this string from the database split it on the placeholder, which generates
    > an array, and iterate through creating your HTML:
    >
    > MyStringTerm = RS.Fields("MyString") ' contains "alpha,bravo,charlie"
    > MyStringArray = Split (MyStringTerm, ",") ' contains
    > ("alpha","bravo","charlie")
    > Response.Write "<ul>"
    > For Each Term In MyStringArray
    > Response.Write "<li>"
    > Response.Write Term
    > Response.Write "</li>"
    > Next
    > Response.Write "</ul>"
    >
    > Alan
    >
    > "vool" <vool@fsnet.com> wrote in message
    > news:eHV4tswYDHA.2032@TK2MSFTNGP10.phx.gbl...
    > > Hi All
    > >
    > > Can anyone help with this please.
    > >
    > > I need a way of putting say 10 to 20 bullet points in one table field in
    > an
    > > Access database
    > > - say seperate them with a special character, then build a bulletted
    list
    > on
    > > my page.
    > >
    > > If I can get the page to detect each special character, insert a new
    > bullet
    > > and move on to the next occurance in the string...
    > >
    > > e.g. point01%point02%point03%point04%point05%point06
    > >
    > > to...
    > >
    > > <ul>
    > > <li>point01</li>
    > > <li>point02</li>
    > > <li>point03</li>
    > > <li>point04</li>
    > > <li>point05</li>
    > > <li>point06</li>
    > > </ul>
    > >
    > > Many thanks in advance
    > >
    > > vool
    > >
    > >
    > > ---
    > > Outgoing mail is certified Virus Free.
    > > Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    > > Version: 6.0.509 / Virus Database: 306 - Release Date: 12/08/2003
    > >
    > >
    >
    >

    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    Version: 6.0.509 / Virus Database: 306 - Release Date: 12/08/2003


    vool Guest

  5. #4

    Default Re: Seperating data from single table field (string)

    I'm glad Alan answered your questions, but I want to add that it's usually a
    bad idea to store multiple pieces of data in a single field. This is a basic
    tenet of proper database design. A better idea would be to create a separate
    table with a one-to-many relationship between the original table and the new
    table, allowing you to store each peice of data in its own row in the new
    table.

    You may be thinking that the list itself is a single piece of data, but this
    is belied by the fact that you need to string together multiple pieces of
    data to form it.

    HTH,
    Bob Barrows

    vool wrote:
    > Hi All
    >
    > Can anyone help with this please.
    >
    > I need a way of putting say 10 to 20 bullet points in one table field
    > in an Access database
    > - say seperate them with a special character, then build a bulletted
    > list on my page.
    >
    > If I can get the page to detect each special character, insert a new
    > bullet and move on to the next occurance in the string...
    >
    > e.g. point01%point02%point03%point04%point05%point06
    >
    > to...
    >
    > <ul>
    > <li>point01</li>
    > <li>point02</li>
    > <li>point03</li>
    > <li>point04</li>
    > <li>point05</li>
    > <li>point06</li>
    > </ul>
    >
    > Many thanks in advance
    >
    > vool
    >
    >
    > ---
    > Outgoing mail is certified Virus Free.
    > Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    > Version: 6.0.509 / Virus Database: 306 - Release Date: 12/08/2003


    Bob Barrows Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139