TonySper
Sun Aug 28 18:05:19 CDT 2005
Thank you all for the help. To bad I did it the hard way as I
eliminated all the insert instructions, took out the ( in front of
each line and the ) at end of each line and then just appended it
delaminated and it worked out fine.
TonySper
"Anders" <anders.altberg@telia.com> wrote in message
news:BF360187.2887%anders.altberg@telia.com...
The only problem is line continuation, but you could work around that
by
removing all the ; (they are SQL end-of-command tokens) and all the
chr(13)+CHR(10) , then insert a CHR(13)+CHR(10) in front of each
INSERT
? OCCURS(CHR(13),lcSQL)
? OCCURS(CHR(10), lcSQL)
lcSQL=FILETOSTR('mysql.txt')
lcSQL=CHRTRAN(lcSQL';','')
lcSQL=CHRTRAN(lcSQL, CHR(13)+CHR(10),'')
lcSQL=STRTRAN(lcSQL,'INSERT ',CHR(13)+CHR(10)+'INSERT '
You should now have 3000 lines of code some 25*60 chars long.
Run the code
&lcSQL
or use STRTOFILE(lcSQL,'Newprog.prg') to write it into a prg file you
can
call.
-Anders
Den 05-08-26 22.34, i artikeln
c0LPe.3441$7F.638@bignews3.bellsouth.net,
skrev "TonySper" <tsperduti@bellsouth.net>:
> Bernhard,
> The following is what was in the file. This was for each record and
> there was 3000 records.
>
> INSERT INTO contacts
>
> (contact_id, first_name, last_name, business_title, address_1,
> address_2, city, state, postal_code, country, home_phone, bus_phone,
> cell_phone, fax_number, e_mail, web, referred, date_stamp,
> created_by,
> notes, admin_accounting, admin_banking, admin_clerical,
> admin_computer, admin_directmail, admin_phone, admin_location,
> lit_bible, lit_trans, lit_donors, cmat_publishers, cmat_writers,
> cmat_printers, cmat_wp, cmat_graphic, cmat_sponser, cmat_css,
> cmat_marketing, cwork_member, cwork_commit, cwork_prospect, cmen_fl,
> cmen_strang, cm_pk, cm_location, church_location, churches,
> ev_films,
> ev_org, ev_ev, ev_mat, fin_month, fin_other, great_com,
> inv_partners,
> ministry, music, para_church, prayer, radio_tv, resources,
> scm_commitee, sm_gender, sm_churches, sm_location, tape_members,
> tape_prospects, tape_billing, tape_location, training,
> training_alum,
> training_location, training_para, training_gc, training_prospect)
>
> VALUES
>
> (1, "John", "Prosser", "CAT III Systems, Inc.", "3022 Oak Hammock
> Drive", "", "Port Orange", "FL", "32129", "US", "386 767-8928", "386
> 788-9404", "", "", "jprosser@catiii.com", "
http://www.catiii.com",
> "",
> "4/22/2003 16:25:45", "JP", "Test", "N", "N", "N", "N", "N", "N",
> "None", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N",
> "N", "N", "N", "N", "N", "None", "None", "United Methodist", "N",
> "N",
> "N", "N", "N", "None", "None", "None", "N", "None", "None", "None",
> "None", "None", "None", "None", "N", "None", "N", "N", "None",
> "None",
> "None", "N", "None", "N", "N", "N");
>
>
>
> This was for the 1st record. Just think of 2999 more like that.
>
> TonySper
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> "Bernhard Sander" <fuchs@individsoft.de> wrote in message
> news:%23zGLKRiqFHA.1336@TK2MSFTNGP11.phx.gbl...
> Hi Tony
>> I received the database and looked at it. It sure is wasteful. It
>> has
>> a enter data for each field before each record spelling out what
>> fields to enter then it has the data comma delimited. I just used
>> my
>> editor and eliminated all the entry information and ended up with a
>> comma delimited txt file after I eliminated the ( and ) after each
>> line. I then made up a table structure and appended from the text
>> file
>> delimited. Worked out OK. Properly more work than if I used MYSql
>> and
>> ran the program to make up a csv file but I did not have MySql and
>> I
>> would have had to download the program and then learn how to use
>> it.
>> Since this was a one shot deal I did it the hard way and did not
>> have
>> to learn (UG UG) another software application.
> Sounds as if the file you received was full of INSERT SQL commands.
> Maybe you just change the file extension to .prg. Then you create
> the
> Fox table
> and run this file as normal Fox procedure.
>
> Regards
> Bernhard Sander.
>
>