On Sun, 2006-10-15 at 10:06 -0500, Charley Tiggs wrote: > Howdy, > > Is it possible to escape the "&" char within the command-line interface? > > Below is a sample of what I have to import for a vendor. There are > about 40 vendors within my file of some 480 to import (I'm moving client > from an old solution to SL). Is it possible to escap the "&" so that it > doesn't throw off everything else? If so, how do I do so? > That looks nasty and AFAIK cannot be directly imported. You need to do some manipulation of the data format to create records from that so an sql command can do the import.
Text fields require delimiters to define the field, periods are a problem since they are an sql operator, and data has to be in fields of a record structure in order to do any of that. name, address1, address2, city, state, zipcode, country, \ contact, phone, fax, email, shiptoname, shiptoaddress1, ... "J&B Imports,Inc.", "PO Box XXXXX", "", "Miami", "FL", 55555, "USA",\ "John", "", "", "", "J&B Imports,Inc.", "PO Box XXXXX", ... Are examples of conversions that AFAIK are needed. The first line is the header line which gives the field names, the next is the matching data from your example. Note that I only included some of the fields. ------------------------- To explicitly answer your question about the &, a simple perl script can read each line and return the line minus the & characters, so it can do a quick pass and conversion for you. Sed and awk are two other tools that can do similar conversions. > Charley > > ./ct.pl "name=J&B Imports,Inc. > &address1=PO Box XXXXX > &address2= > &city=Miami > &state=FL > &zipcode=55555 > &country=USA > &contact=John > &phone= > &fax= > &email= > &shiptoname=J&B Imports,Inc. > &shiptoaddress1=PO Box XXXXX > &shiptoaddress2= > &shiptocity=Miami > &shiptostate=FL > &shiptozipcode=55555 > &shiptocountry=USA > &shiptocontact=John > &shiptophone= > &shiptofax= > &shiptoemail= > &tax_2150=1 > &startdate=10-15-2006 > &creditlimit= > &terms=Pre-Pd > &curr=USD > &employee=turkey--11186 > ¬es= > &id= > &taxaccounts=2150 > &path=bin/mozilla > &login=turkey > &password=badonkydonk > &db=vendor > &action=Save" > ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ sql-ledger-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sql-ledger-users
