Link to home
Start Free TrialLog in
Avatar of M DXYZ
M DXYZFlag for United States of America

asked on

Bash script to insert text into MYSQL

Hi,

I have a table with the following fields:

PDI Number, Category, Reference, Description, Status, Example, Script Version, UNIX Checklist Page.

Now the list is going will have several PDI's and each one will have all of the fields above.

I look forward hearing from you.

Regards,

Michael
PDI Number: EXA000260
Category: FAT II
Reference: LINUX 3.1
Description: A shared account is not documented by the IAO.
Status: Open

For example:
ZEN000260: The following accounts require justifying documentation from the IAO.
ACCT     LOGGED IN FROM
-------   --------------
sysadmin Fri
sysadmin Mon
sysadmin Sat
sysadmin Sun
sysadmin Thu
sysadmin Tue
sysadmin Wed

Script Version: Jan2009
UNIX Checklist Page: 30

Open in new window

Avatar of MarioAlcaide
MarioAlcaide

Hello,

You can use the command LOAD DATA for that purpose. For example: mysql> LOAD DATA LOCAL INFILE '/path/pet.txt' INTO TABLE pet;

http://dev.mysql.com/doc/refman/5.0/en/loading-tables.html
Was this helpful for you?
ASKER CERTIFIED SOLUTION
Avatar of mankowitz
mankowitz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial