in reply to convert flat file to MySQL

Strongly recommend you check out the MySQL documentation page. Also have a look at this article for background on DBI which is probably how you'd implement your interface to MySQL.

It is reasonably easy to set up an SQL statement of the form

INSERT [LOW_PRIORITY | DELAYED] [IGNORE] [INTO] tbl_name [(col_name,...)] VALUES (expression,...),(...),...
(grabbed from their docs, section 6.4.3, INSERT Syntax).

Instead of relying on positioning (as you are now with your flat file, using either offsets or field separators), you can insert the field values by name.

insert into sales (agent, stock_num, value) values ("AB234","RB-55602","6500")

Finally, try doing a search on this site for MySQL. You'll probably find a wealth of information.

--t. alex

"Of course, you realize that this means war." -- Bugs Bunny.