* Trevor > after a bit of help on how to import data from a pastel > accounting database into mysql, i also need to remove some lines > out of the pastel txt file before importing into mysql
You are defining your new problem to be something to be sorted out before mysql is involved, in which case this list is the wrong forum. You would use a programming language or text stream editor tool, or maybe even a text editor, if the amount of data is small. Which of those you would choose depends on your OS and your previous knowledge. However, your problem can probably also be solved within mysql. > eg 1 > "*PC\CC-ABS533 ","COMPUCON Abacus Celeron/Pentium PC > ",0,0,0,0,0,0,0,0,0,0,0,0,0,0,"","" > > has to end up with this data > "*PC\CC-ABS533 ","COMPUCON Abacus Celeron/Pentium PC ",0 > > eg2 > "NCHW\IQISW050R ","iNEQ Wireless BB Rou.& USB PrnServer > ",218,217,0,0,239.8,238.7,0,0,0,0,0,0,0,0,""," > > has to end up with this data > "NCHW\IQISW050R ","iNEQ Wireless BB Rou.& USB PrnServer ",218 Looks like you wish to drop many of the columns? You can do that after the import, using the ALTER TABLE statement, or you can avoid importing them in the first place, using a field list in the LOAD DATA statement. <URL: http://www.mysql.com/doc/en/ALTER_TABLE.html > <URL: http://www.mysql.com/doc/en/LOAD_DATA.html > > in the same file it has line as follows, they have a common > factor "zz, these lines need to be deleted > "ZVPX\ARDX550 ","zz BenQ DX550 1200 Lum. XGA DLP AV-Box You can delete rows after the data is imported, using a DELETE statement. If the column was named ProdName and the table was named Products: DELETE FROM Products WHERE ProdName LIKE "zz%"; <URL: http://www.mysql.com/doc/en/DELETE.html > -- Roger -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]