1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'T&T - Functions' started by Peter Murschall, May 6, 2014.

  1. Peter Murschall

    Joined:
    Sep 3, 2010
    Messages:
    33
    Likes Received:
    0
    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. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    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. Peter Murschall

    Joined:
    Sep 3, 2010
    Messages:
    33
    Likes Received:
    0
    Many thanks for Your prompt reply, Steve.

    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 :-(
     

Share This Page