Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Split and File Merge
Message
From
06/11/2006 14:32:07
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
06/11/2006 04:22:31
Napoleon Yam
Princess Cruises: Emerald Princess
Caribbean, Philippines
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01167271
Message ID:
01167426
Views:
6
>how can we split and merge file (.dbf, .xml etc.) in vfp?
>
>thanks,
>Nap

I will assume that you mean the following: Split a file to pieces, for example 1,000,000 bytes each, to fit on a diskette, to have a reasonable size for e-mail attachments, etc.

To split:

You can read the entire file into a memory variable with FileToStr(), extract the the individual pieces with substr(), and copy those back to disk with StrToFile().

To combine:

Read the individual pieces with FileToStr(), and add them to a new file with StrToFile(). Use the appropriate parameter with StrToFile(), to append to the end of the file instead of overwriting.

HTH,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform