Exporting Access to MySQL (again)

Stoilis Giannis stoilis at sadness.gr
Sun Oct 7 11:58:01 EEST 2001


Geia sas,
8a h8ela na epaner8w sto 8ema ths metatrophs basewn dedomenwn access sthn 
MySQL.
Exw mono ena mhxanhma sthn dia8esh mou pou einai dual-boot, ara den mporw na 
kanw to export apo thn access se real-time me ton ODBC driver gia mysql.
Exw kanei omws export thn bash se text arxeio pou xwrizei ta diafora pedia me 
TABS, ara upoti8etai oti mporw na to kanw import me "mysqlimport".
To problhma mou einai ena pedio ths bashs, to opoio einai arketa kb se ka8e 
eggrafh. H access, gia na morfopoihsh to sugkekrimeno pedio, bazei ena 
newline charachter ka8e perippou  50 xarakthres. Gia na katalabete ti ennow, 
deite ligo to parakatw paradeigma me 2 eggrafes:
EXPORTED TXT FILE:
1	eggafi1-pedio2	"eggafi1-pedio3 eggafi1-pedio3 eggafi1-pedio3
eggafi1-pedio3 eggafi1-pedio3"	eggafi1-pedio4
2	eggrafi2-pedio2	"eggrafi2-pedio3 eggrafh2-pedio3 eggrafh2-pedio3
egrafi2-pedio3 eggrafh2-pedio3"	eggrafh2-pedio4

Otan paw na kanw import to parapanw arxeio, to mysqlimport nomizei oti exei 4 
egraffes. Eutuxws, to sugkekrimeno pedio einai enclosed me eiswgwgika(") 
opote mas dinei na katalaboume ta oria tou sugkekrimenou pediou.
Pws 8a mporesw na kanw to mysql na katalabei pws leitourgei to parapanw 
arxeio? To trexw me `--fields-optionally-enclosed-by=\"` alla den fainetai na 
kanei douleia kati tetoio. Mhpws kanw escape me la8os tropo to sumbolo tou 
eisagwgikou?
Mhpws na to prosseggisw kapws alliws to problhma? Mhpws p.x. na mporesw me 
kapoia regexp kai na bgalw entelws to newline, otan einai mesa sta 
eisagwnika? Poios kalos regexp gurou 8a mou pei pws 8a to kanw auto me sed? 
keramida, akous??? :-)
8a eixa thn upomonh na to kanw me to xeri, mono kai mono gia na glitwsw, alla 
h database einai dekades MB ;-(
Genika, to documentation ths mysql den fainetai na ekshgei thn dikia mou 
periptwsh. Epsaksa kai ligo sto internet gia peraiterw plhrofories, alla den 
brhka tipota aksiologo. Exei kapoio link kapoios na koitaksw na fwtistw?

Euxaristw ek twn proterwn
Filika
- Stoilis Giannis



More information about the Linux-greek-users mailing list