Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: Michael Milling
  Where is Michael Milling?
 Mobile
 Alabama - United States
 Michael Milling
 Tags
Subject: RE: Tab delimited file to ALINES
Thread ID: 395556 Message ID: 395581 # Views: 50 # Ratings: 5
Version: Visual FoxPro 6 Category: General VFP Topics
Date: Thursday, January 16, 2014 12:04:51 AM         
   


> Hello all,
>
> I am trying to add 4 columns to an array from a .TXT file, where each field is delimited with a TAB. 2 of the columns in my .TXT file have strings that run over 254 characters, so I am creating a cursor with 2 memo fields to accommodate them so no data is lost. So far I am able to create a single column cursor and populate it from a single column array:
>
>
CREATE CURSOR cTemp(oldMemo m)
> 
> FOR i = 1 TO ALINES(aTemp, FILETOSTR("file with path"))
>      INSERT INTO cTemp(oldMemo) VALUES (aTemp)
> ENDFOR

>
>
> What I need is to do this with 3 additional columns:
>
>
CREATE CURSOR cTemp(example1 c(10), example2 c(10), oldMemo m, newMemo m))
> 
> FOR i = 1 TO ALINES(aTemp, FILETOSTR("file with path")) &&Delimited somehow?
>      INSERT INTO cTemp(example1, example2, oldMemo, newMemo) VALUES (aTemp1, 2, 3, 4)
> ENDFOR

>
>
> I hope this does not look like complete jibberish, and I appreciate the feedback!
>
> -Mike

lnRows=ALINES(aTemp,m.Mytext,1,CHR(9),CHR(13))
DIMENSION aTemp(lnRows/4,4) 
INSERT INTO cTemp FROM ARRAY aTemp

-Anders

ENTIRE THREAD

Tab delimited file to ALINES Posted by Michael Milling @ 1/15/2014 9:01:27 PM
RE: Tab delimited file to ALINES Posted by Ali Koumaiha @ 1/15/2014 9:18:14 PM
RE: Tab delimited file to ALINES Posted by Michael Milling @ 1/15/2014 9:23:14 PM
RE: Tab delimited file to ALINES Posted by Vilhelm-Ion Praisach @ 1/15/2014 9:32:43 PM
RE: Tab delimited file to ALINES Posted by Stefan Wuebbe @ 1/15/2014 9:44:18 PM
RE: Tab delimited file to ALINES Posted by Michael Milling @ 1/15/2014 10:06:45 PM
RE: Tab delimited file to ALINES Posted by Vilhelm-Ion Praisach @ 1/16/2014 5:24:24 AM
RE: Tab delimited file to ALINES Posted by Michael Milling @ 1/16/2014 8:12:37 PM
RE: Tab delimited file to ALINES Posted by Stefan Wuebbe @ 1/16/2014 6:04:11 AM
RE: Tab delimited file to ALINES Posted by Anders Altberg @ 1/16/2014 12:04:51 AM