Community Server

The platform that enables you to build rich, interactive communities
Welcome to Community Server Sign in | Join | Help
in Search

Inputting large amounts of data

Last post 03-24-2007, 8:42 AM by Random Walker. 1 replies.
Sort Posts: Previous Next
  •  03-23-2007, 8:52 AM 30

    Inputting large amounts of data

    How does one input large amounts of data from sources such as excel without having to go through the hassle of prior reformatting (data is in column form)? 
  •  03-24-2007, 8:42 AM 31 in reply to 30

    Re: Inputting large amounts of data

    Jebus,

    You can have Excel export the data to a tab-delimited file or a csv file. Then just use the READ command (without any formatting specifications) to read it in. Here's an example:

    Input data file (csv):

    1,1,1
    1,2,2
    1,,3      <- missing element in 2nd column
    1,4,4
    1,5,5
    1,6,6
    1,7       <- Third column is shorter
    1,8 
    1,9 

    Here's a Statistics101 program to read and print data file:

    READ a b c
    PRINT a b c


    Since I didn't put the input file's name in the READ command, it will present an "Open File" dialog to allow me to find it. Here's the Statistics101 program's output:

    a: (1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0)
    b: (1.0 2.0 NaN 4.0 5.0 6.0 7.0 8.0 9.0)
    c: (1.0 2.0 3.0 4.0 5.0 6.0 NaN NaN NaN)


    Note that any columns that are shorter than the longest column are filled-out with "NaN", which means "Not a Number". Also, any column that has an empty row will have that row replaced with "NaN". You can read about how NaN is handled in the Statistics101 docs.

    Hope that answers your question. If not, please let me know.

    Thanks

    John Grosberg

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems