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

What is the fastest way to dump a array

Discussion in 'Support' started by Arjan Feddema, Jan 15, 2009.

  1. Arjan Feddema

    Joined:
    Jun 20, 2008
    Messages:
    39
    Likes Received:
    0
    Shouldn't there be a reverse @filearray? With multi-dimensional support.

    BTW. Why is the @filearray only one-dimensional?

    Arjan
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,991
    Likes Received:
    84
    NITV. A reverse @filearray would only require 2 or 3 lines in a user-defined function. (Though I don't know why you'd use it.)

    @FILEARRAY is one-dimensional because there's no way to predetermine the file's format, and using the wrong format would terminally trash the array. (The beta testers requested this as well, though none of them could actually come up with either a format or a reason for it.)
     
  3. Arjan Feddema

    Joined:
    Jun 20, 2008
    Messages:
    39
    Likes Received:
    0
    ---Quote
    @FILEARRAY is one-dimensional because there's no way to predetermine the file's format, and using the wrong format would terminally trash the array.
    ---End Quote---


    I see your point. But what about this example?

    If I would like to use a .csv file for reading information, I have to read the file in an array and then afterwards separate the columns in the .csv in to separate vars or another array. How about an extra option in @fileread that allows me to define the seperator in a line so that will break-up the information and place them in different elements.
    The same for @EXECARRAY: @execarray[aresult,pdir /(f)/(",")/(i)]. Two columns separated by a comma.

    Having read a complete .csv into a multi-dimensional array, gives me a virtual spreadsheat, that is far easier to manipulate then trying to manipulate a .csv file.
    Hence my question how to dump this array back to a file.

    ---Quote
    : A reverse @filearray would only require 2 or 3 lines in a user-defined function.
    ---End Quote---

    Would you please be so kind to give a me an example of such a function, I can't seem to figure out how something like that can be achieved.

    Kind regards,

    Arjan Feddema
     
  4. Arjan Feddema

    Joined:
    Jun 20, 2008
    Messages:
    39
    Likes Received:
    0
    Re: What is the fastest way to dump a array

    ---Quote
    @FILEARRAY is one-dimensional because there's no way to predetermine the file's format, and using the wrong format would terminally trash the array.
    ---End Quote---


    I see your point. But what about this example?

    If I would like to use a .csv file for reading information, I have to read the file in an array and then afterwards separate the columns in the .csv in to separate vars or another array. How about an extra option in @fileread that allows me to define the seperator in a line so that will break-up the information and place them in different elements.
    The same for @EXECARRAY: @execarray[aresult,pdir /(f)/(",")/(i)]. Two columns separated by a comma.

    Having read a complete .csv into a multi-dimensional array, gives me a virtual spreadsheat, that is far easier to manipulate then trying to manipulate a .csv file.
    Hence my question how to dump this array back to a file.

    ---Quote
    : A reverse @filearray would only require 2 or 3 lines in a user-defined function.
    ---End Quote---

    Would you please be so kind to give a me an example of such a function, I can't seem to figure out how something like that can be achieved.

    Kind regards,

    Arjan Feddema






    *********** REPLY SEPARATOR ***********

    On 15-1-2009 at 20:03 rconn wrote:


     
  5. Arjan Feddema

    Joined:
    Jun 20, 2008
    Messages:
    39
    Likes Received:
    0
    ---Quote
    @FILEARRAY is one-dimensional because there's no way to predetermine the file's format, and using the wrong format would terminally trash the array.
    ---End Quote---


    I see your point. But what about this example?

    If I would like to use a .csv file for reading information, I have to read the file in an array and then afterwards separate the columns in the .csv in to separate vars or another array. How about an extra option in @fileread that allows me to define the seperator in a line so that will break-up the information and place them in different elements.
    The same for @EXECARRAY: @execarray[aresult,pdir /(f)/(",")/(i)]. Two columns separated by a comma.

    Having read a complete .csv into a multi-dimensional array, gives me a virtual spreadsheat, that is far easier to manipulate then trying to manipulate a .csv file.
    Hence my question how to dump this array back to a file.

    ---Quote
    : A reverse @filearray would only require 2 or 3 lines in a user-defined function.
    ---End Quote---

    Would you please be so kind to give a me an example of such a function, I can't seem to figure out how something like that can be achieved.

    Kind regards,

    Arjan Feddema






    *********** REPLY SEPARATOR ***********

    On 15-1-2009 at 20:03 rconn wrote:


     

Share This Page