From: Eric Bergen Date: April 18 2005 10:40pm Subject: Re: mysql import or write my own Perl parser List-Archive: http://lists.mysql.com/mysql/182811 Message-Id: <11b1bd99050418154025c6ef59@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable awk is probably the best tool I can think of for cutting columns out of a text file. Something like awk -F \\t '{ print $2 "," $3 }' my_file could be used to pick the second and third column out of a file prior to importing it. -Eric On 4/18/05, newbie c wrote: > Hi, >=20 > I am about to create a database and there are a number of files that I ne= ed > to load into the database. They are tab delimited files. One of the fil= es contains about 4 or 5 columns. I am only interested in the second and t= he third column right now but I will load the whole table. The values in t= he second column can occur more than once in the file. > As well the values in the third column can occur more than once in the fi= le. >=20 > Another file that I want to load as a table into the databse only contain= s two > column and one column will be unique while the second column will have > duplicate values in the file. >=20 > My question is when should I use mysqlimport, or load data and when shoul= d I write my own Perl parser to help load the table? > What criteria would be needed to decide to read a file into a hash? >=20 > Also, if I decide to use mysqlimport is there anything I should watch out= for? >=20 > thanks! >=20 >=20 > --------------------------------- > Post your free ad now! Yahoo! Canada Personals >=20 >=20 --=20 Eric Bergen eric.bergen@stripped http://www.ebergen.net