[ale] Fore (Was Re: [ale] Simple Perl Question)

Fletch fletch at phydeaux.org
Mon Feb 25 11:34:33 EST 2002



[...]

    Bob> I am reading lines of data from a file and doing an extract
    Bob> to go into a SQL database.  Fields are delimited by "|".
    Bob> There are 12 fields per line.  I would like to read each
    Bob> line into an array, and then export four of the fields.  So,
    Bob> and extract could be:

perl -F\\\| -lane 'print q{insert into foo values ("},join(q{",}, at F[0,4,6,9]),qq{")\n}' ./52.txt | $YOUR_DB_PROG

-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch at phydeaux.org   |  Vincent, you should cease askin'          \ o.O'
770 933-0600 x211(w)  |  scary questions." -- Jules                =(___)=
                      |                                               U

---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list