Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem CSV File
Message
 
 
To
04/10/2007 07:24:41
Neil Mc Donald
Cencom Systems P/L
The Sun, Australia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01258459
Message ID:
01258465
Views:
27
This message has been marked as the solution to the initial question of the thread.
Hi Neil,

What about
lcBuffer = FILETOSTR(lcFileName)
lcBuffer = STRTRAN(lcBuffer, CHR(13) + CHR(10), "##CR##LF##")
DIMENSION laLines[1]
FOR i=1 TO ALINES(laLines, lcBuffer)
  * Parse line here and convert "##CR##LF##" back to CHR(13) + CHR(10) for the memo
  INSERT INTO ...
ENDFOR
>I am trying to code an import of a non standard CSV file.
>The data starts at line 1 of the file.
>The main problem is the second field contains commas & Carriage return line feed pairs within it and can be from 10 to 1200 characters in length.
>
>I have listed some sample data below.
>
>
>"AA0001","AA0001 has the following classes, <CR><LF>1. Class1<CR><LF>2. Classes 2, 3 & 4<CR><LF>Blah Blah","600.00",60,,"AA001"<CR>
>"AA0002","AA0002 has the following class, <CR><LF>1. Class1<CR><LF>Blah Blah","700.00",50,,"AA002"<CR>
>
>
>Does anyone have any code on how to import the second field as FGETS truncations at the first and I need to import it into a Memo field
>
>Thanks in advance
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform