Is there an equivalent to SETARRAY /R file, varname ?

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
#1
Hallo at all,

at this time I'm working with "glueing" a lot of textfiles together to a big one and I've use the TCC-%@FILE-Functions OPEN/READ/CLOSE) with a little bit recordselection.
1) Open Target
2) Loop:Open Source
3) Read line from source
4) skip if condition or write line to target
6) close source
7) open next source til loop end
8) close target
Now I've tested it with ARRAY-Variables, - that means read the source first into an Array and than write it to the target - and I've get a big performance improvement !
The next improvement was the useage of SETARRAY /R filespec, varname so I have not to determine the dimensions of the array.
The question is: Is there a Function or a method like GETARRAY[] which will do the opposite function of SETARRAY /R and write the complete array into a file ?
Now I must do it with
Set Firstrec=%@IF[%@INDEX[%arDatenliste[0],TICKER] EQ -1,0,1]
Set
LastRecord=%@EVAL[%@ARRAYINFO[arDatenliste,1]-1]
For /L %zz in (%firstrec%,1,%LastRecord) Do Echo
%@FILEWRITE[%fhzieldatei,%arDatenliste[%zz]]
I think, that the FOR-Loop is not the fastest ....

Mit freundlichsten Grüßen

Peter Murschall
 
#2
The plug=in Textutils.DLL from Charles Dye (prospero.unm.edu) has a pair of functions, SAVEARRAY and LOADARRAY, which work with 1 dimensional arrays. SAVEARRAY stores it in a file, and must be used from the array built first, so at future time you can restore it with LOADARRAY. The file is in a special format, not a regular text file.
 
#3
The plug=in Textutils.DLL from Charles Dye (prospero.unm.edu) has a pair of functions, SAVEARRAY and LOADARRAY, which work with 1 dimensional arrays.
Many thanks for Your prompt reply, Steve.

SAVEARRAY stores it in a file, and must be used from the array built first, so at future time you can restore it with LOADARRAY. The file is in a special format, not a regular text file.
I've try the plugin and it works very fast, but sadly not in a manner that I can use, it will make to much modifications with the text :-(