Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to copy text file line by line to memo field?
Message
From
10/07/2006 04:24:17
 
 
To
10/07/2006 04:19:19
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01134853
Message ID:
01134854
Views:
15
This message has been marked as the solution to the initial question of the thread.
>Hi all,
>
>I have text files with lines of data and I wanted to copy them line by line to a memo field of a table, 1st line go to 1st record, 2nd line go to 2nd record. I have tried the following codes but somehow when the length of the line exceeds 50, it will append the following characters into 2nd record. Any idea?
>
>
>
>CREATE CURSOR lctest (mdata m)
>nline = MEMLINES(FILETOSTR(TRANSFORM(lcfile))) && lcfile = file name
>	
>FOR i=1 TO nline
>   INSERT INTO lctest VALUES (MLINE(FILETOSTR(TRANSFORM(lcfile)),i))
>ENDFOR
>
>
Increase the SET MEMOWIDTH value
And by the way, copy the file to a memory variable, it will be much faster
CREATE CURSOR lctest (mdata m)
lcText=FILETOSTR(TRANSFORM(lcfile))
nline = MEMLINES(lcText)
	
FOR i=1 TO nline
   INSERT INTO lctest VALUES (MLINE(lcText,i))
ENDFOR
Previous
Reply
Map
View

Click here to load this message in the networking platform