Re: Reading files

From: William Park (opengeometry@yahoo.ca)
Date: 04/15/03


From: William Park <opengeometry@yahoo.ca>
Date: 15 Apr 2003 17:35:26 GMT

ricky <rkreidl@wi.rr.com> wrote:
> I have a file that has two columns of data separated by a space. How
> would you go about reading the file and storing each field in a
> different array variable.
> example file below. This file has 5 records and 2 fields in each
> record. I want to store each field in a separate variable. This is to
> be written in Korn shell.
>
> File
> ========
>
> absddsad effdsfer
> fe43wfsdsds dsddsf3
> dsdse2eds 343fdsd3
> sdsds dsfsdf4r33
> sdassa er353fds
>
> thanks

var1=( `awk '{print $1}' file` )
var2=( `awk '{print $2}' file` )

-- 
William Park, Open Geometry Consulting, <opengeometry@yahoo.ca>
Linux solution for data management and processing. 


Relevant Pages

  • Reading files
    ... would you go about reading the file and storing each field in a ... sdsds dsfsdf4r33 ... sdassa er353fds ...
    (comp.unix.shell)
  • Re: vector <int> load from file
    ... > I figured out how to put a vector of ints out into a file. ... You start by storing _all_ the information about the vector you're ... Once you've done that, reading in a vector is pretty trivial: ... open the file and read the first file. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Limit To List - table showing incorrect data
    ... After reading your message I was able to search through some posts ... unbound text box is not storing the correct value. ... On Nov 18, 12:26 pm, John W. Vinson ...
    (microsoft.public.access.formscoding)
  • Re: Concurrency problems
    ... >I cannot use lock hints because the connection is closed after reading the ... >Storing the PK in separate table is good idea but if the client which has ...
    (microsoft.public.sqlserver.server)
  • Re: Concurrency problems
    ... >I cannot use lock hints because the connection is closed after reading the ... >Storing the PK in separate table is good idea but if the client which has ...
    (microsoft.public.sqlserver.programming)