Source language: Translate to:

Extract Embedded Files

General questions about NeoBook

Moderator: Neosoft Support

Extract Embedded Files

Postby StarterPack » Mon Jul 17, 2017 2:16 am

Hi guys.... I have 2000 text files embedded. I need to extract all files to a selected folder. Is there a way without telling each file to extract, cause it will take me a long time : )
StarterPack
 
Posts: 111
Joined: Fri Feb 19, 2016 6:55 am

Re: Extract Embedded Files

Postby Gaev » Mon Jul 17, 2017 5:02 am

StarterPack:

If you MUST create 2000 files on the user's computer at run time, it IS going to take some time ... the only point is whether some extraction programs/techniques take less time than NeoBook's ExtractFile command.

You might consider these two methods of "embedding all your content as a single file" ... and then "splitting it up" at run time ...

a) create/embed a zip file of the 2000 files ... at run time, extract the one .zip and then unzip it (or perhaps use a self extracting zip file) ... you might even consider embedding your NeoBook Application (.exe) as one of the zipped files ... that way, the user just runs the self extracting zip ... and has all 2001 files in a single folder.

b) depending on the number of total lines of text in the 2000 files, you could make up your "custom packed file" (where the content of each of the 2000 files is appended and separated by some unique separator line e.g. /////*****filename.txt****\\\\) ... then, embed this one file ... at run time ...

- extract this file
- FileRead its contents into a variable (use "All" for line number)
- StrParse the variable using the unique separator string e.g. /////*****
- Loop through all elements of the resulting arrayed variable and FileWrite contents of each element


Of course, I would also ask why you need to hold this information as 2000 files ... why not save the contents in an Access database ? ... and get the contents of each file as/when desired ?
User avatar
Gaev
 
Posts: 3674
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 1 guest

cron