[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



[...]

    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.