if file('tmaster.csv') new file().delete('tmaster.csv') endif if file('tmaster.dbf') drop table tmaster endif create table tmaster (; id numeric(11), ; part_no char(10), ; title char(35), ; qty numeric(6,0), ; sell numeric(7), ; grade char(16), ; mfg char(35), ; cuml numeric(5,0), ; sdate date, ; asell numeric(7), ; au_desc char(254)) use tmaster append from master for asell # 0 and title # null and part_no < "AF00760X" scan replace part_no with escape_quote(part_no) replace au_desc with escape_quote(au_desc) replace id with recno() endscan go bottom msgbox( "Count is " +id+ ". The master.csv file must be ftped to the correct directory before importing into mysql." ) copy to tmaster.csv delim use cFileIn ='tmaster.csv' cFileOut = 'tempworkfile.txt' fIn = new file() fIn.open(cFileIn) fOut = new file() fOut.create(cFileOut) do while not fIn.eof() cRead = fIn.gets() If not chr(26)$cRead fOut.Puts(cRead) endif enddo fIn.close() fOut.close() new file().delete(cFileIn) new file().rename(cFileOut,cFileIn) function escape_quote(cStr) for n = len(cStr) to 1 step -1 if substr(cStr,n,1) = ["] cStr = stuff(cStr,n,1,[\"]) endif next return cStr