Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filetostr()->group of separate files
Message
From
08/05/2009 00:45:02
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
08/05/2009 00:29:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01398517
Message ID:
01398518
Views:
113
This message has been marked as the solution to the initial question of the thread.
Hi Karen,

to the first:
place code snippets in pre tags. (See help, also try to reply this message). This will allow the symbols.

I'm not shure what failed exactly (there are some obvious errors and some not so) but try
FN = 1
strtofile('','m.txt')
for fn = 1 to 83
 FNO = "xp"+TRIM(PADL(fn,2))+".prg"
 if file(fno)
  strtofile(filetostr(fno),'m.txt',1)
 endif
NEXT
You may also consider to use ADIR() to get the files, but if the number is fixed to 1 ... 83 this might be not usefull.

Note: The code above has limitiations if one of the files above is to large. In this case you would need the read the files lowlevel

HTH
Agnes
>i have group of files stored separately from xp1.prg to xp83.prg
>i would like to assimilate all into one text file. This was my modest attempt to do so - it failed
>what am i doing wrong?
>
>FN = 1
>lcbody = " "
>do while fn (lessthan ) 83 &&apparently i can't use the less than symbol for the posting
>FNO = "xp"+ltrim(str(fn))+".prg"
>if file('&fno')
>copy file &fno to m.txt addit
>lcBody =lcbody+filetostr('m.txt')
>endif
>
>fn = fn+1
>loop
>enddo
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform