Mailinglisten-Archive |
Uwe Drießen schrieb:
> folgende Textdatei soll in eine Tabelle eingelesen werden :
>
> Source Destination Packets Bytes
> 213.173.68.203 213.183.86.195 2 96
> 213.183.86.25 213.37.53.232 1 56
> 213.183.86.119 194.81.151.71 3 426
> 194.81.151.71 213.183.86.119 3 224
> 213.181.161.239 213.183.86.26 1 92
> 80.61.197.15 213.183.86.147 1 55
> 213.183.86.147 80.61.197.15 1 55
> 213.183.86.119 69.90.40.116 1 130
>
> Der Versuch mit :
> LOAD DATA LOCAL INFILE '...'
> INTO Table cisco
> FIELDS TERMINATED BY " "
> LINES TERMINATED BY '\r\n'
> IGNORE 8 LINES
> (Source,Destination,Packets,Bytes)
"If the FIELDS TERMINATED BY and FIELDS ENCLOSED BY values are both
empty (''), a fixed-row (non-delimited) format is used. With fixed-row
format, no delimiters are used between fields (but you can still have a
line terminator). Instead, column values are written and read using the
``display'' widths of the columns. For example, if a column is declared
as INT(7), values for the column are written using seven-character
fields. On input, values for the column are obtained by reading seven
characters."
http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html
> Tabellenstruktur
> Feld Typ Attribute Null Standard Extra Aktion
> radint int(11) Nein auto_increment
> Source varchar(20) Ja NULL
> Destination varchar(20) Ja NULL
> Packets decimal(13,0) Ja NULL
> Bytes decimal(20,0) Ja NULL
> frei varchar(20) Ja NULL
Tabellenstruktur
Feld Typ Attribute Null Standard Extra Aktion
radint int(11) Nein auto_increment
Source varchar(17) Nein ''
Destination varchar(17) Nein ''
Packets int(18) Nein 0
Bytes int(20) Nein 0
frei varchar(20) Nein ''
> Kann solch ein File überhaupt von MySql verarbeitet werden ich finde im
> Internet leider keinerlei Beispiele für solch einen Fall.
Ja, steht im Handbuch.
--
Sebastian Mendel
www.sebastianmendel.de www.warzonez.de www.tekkno4u.de www.nofetish.com
www.sf.net/projects/phpdatetime www.sf.net/projects/phptimesheet
--
Infos zur Mailingliste, zur Teilnahme und zum An- und Abmelden unter
-->> http://www.4t2.com/mysql
php::bar PHP Wiki - Listenarchive