Thanks Peter

Ketan Patel
G3 Technology Group, LLC
Graphics III Advertising, Inc.
(410)789-7007 or (800)783-1799
"It's Not Creative if it doesn't Sell."
http://www.g3group.com <http://www.g3group.com>

  -----Original Message-----
  From: Pascal Peters [mailto:[EMAIL PROTECTED]
  Sent: Thursday, December 11, 2003 10:18 AM
  To: CF-RegEx
  Subject: RE: Regular _expression_ help on parsing.

  No need for regexp here, just use lists
  <cfset stTmp = StructNew()>
  <cfloop list="#theProduct#" index="line" delimiters="#chr(10)#">
  <cfset stTemp[ListFirst(line,"|")] = ListRest(line,"|")>
  </cfloop>

  I am assuming the properties are separated by a newline.
  Then you can use the structure to insert into the database (ore whatever
  you are doing).
  -----Original Message-----
  From: Ketan Patel [mailto:[EMAIL PROTECTED]
  Sent: donderdag 11 december 2003 16:10
  To: CF-RegEx
  Subject: RE: Regular _expression_ help on parsing.

  I figured out half of the solution. Just need to know how to parse
  SKU|1234566
  name|Polynesian Fish Lifestyle Shirt
  description|60% Cotton, 40% Rayon.Available in Marine and Pine, and in
  sizes
  S-XXL. color|<select name="HOO-M011062-color"><option
  value="Marine">Marine<option value="Pine">Pine</select>
  size|<select name="HOO-M011062-size"><option value="S">S<option
  value="M">M<option value="L">L<option value="XL">XL<option
  value="XXL">XXL</select>
  price|4399
  title|Polynesian Fish Lifestyle Shirt from Sportailer Inc.'s.
  image|/clothing/polynesianfish.jpg
  category|clothing
  vendor|hookandtackle
  shippinginfo|Shipping for this clothing item is $5.25 if your total
  clothing
  order is under $100. Shipping is free if your total clothing order
  exceeds
  $100.
  title2|Cargo Shorts, Short, Hawaiian, Tropical Shirt, Clothing at White
  Marlin Designs

  I am looking for a solution to parse the | delinitaed string . I know I
  can
  do using cfloop but dont want to do that becuase my file has about 200
  products similar to above. I allready have a cfloop seperating each
  product.
  Now inside that product I have seperate the fields and values for them
  and
  then insert in database. The deliminator here is | (pipe)

  Above say example:

  category|clothing

  category is the field name and clothing is the value for that caetgory
  field. Which is seprated by | (pipe)
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to