In python
-
import re
file = open(path/to/file,r)
for line in file:
line = line.replace(\n,)# this is not always needed
columns = re.split(\s+,line)
print columns#is now a list
print columns[0]
sql = insert into ...
-
I have a text file that is in the Panasonic DBS format. It is a log file
that comes from my phone system. I have a program that monitors the serial
port and write the input to a file. I have no control over the format of
the file. I would like to on a nightly basis shut down the logging
Your first instinct is correct, a parsing script in the language of
your choice would make short work of this.
- michael
On 7/6/07, Scott Swaim [EMAIL PROTECTED] wrote:
I have a text file that is in the Panasonic DBS format. It is a log file
that comes from my phone system. I have a program
adrian GREEMAN [EMAIL PROTECTED] wrote:
When I try to import a text file with new data for an existing
table I get the error 1148 - the used command is not allowed
with this MySQL version.
If you use LOAD DATA LOCAL you should enabled it with local-infile option.
I have tried with both
adrian GREEMAN [EMAIL PROTECTED] wrote:
I have also read the manual section on this {as I should have
done] to try and understand it
and how to enable reading a local file - the discussion section
seems confusing and confused.
I tried following what others have done and
modified the ini
FYI
After digging out some documentation ( RFM indeed ) it is all so simple in
DBD::mysql ...
As of version 3.23.49 LOCAL within LOAD DATA _may_ be disabled in the
_client_ library. By adding an option to the DSN-string within the connect
statement the function is re-enabled at the client side
When I try to import a text file with new data for an existing
table I get the error 1148 - the used command is not allowed
with this MySQL version.
I have tried with both PHPMyAdmin2.3 and with MySQLFront 2.5.
Both these GUI programmes have an import from text file command
which I have used
adrian GREEMAN wrote:
I have also read the manual section on this {as I should have
done] to try and understand it
and how to enable reading a local file - the discussion section
seems confusing and confused.
I tried following what others have done and
modified the ini file with
I have also read the manual section on this {as I should have
done] to try and understand it
and how to enable reading a local file - the discussion section
seems confusing and confused.
I tried following what others have done and
modified the ini file with set-variable=local-infile=0
and with
Thanks for the advice - and your patience in giving it to me.
The recommended changes in the ini file worked (but only along
with removing the word local from the load data local infile
instruction) [since I have a localhost Apache server as testing
environment]
thanks again to those more
Please excuse a relative amateur worrying a problem.
I got a nice reply from Victoria Reznichenko yesterday on a
difficulty loading data from a text file. She said 4.0.12 had a
bug and, I as understood her answer, I should therefore enable
load local infile.
Instead I uninstalled 4.0.12 and
hello all,
i am trying to install web calendar software on my machine, which is
available at sourceforge.net website. to run that software first of all
a textfile named tables-mysql.sql needs to imported into the mysql
database. for doing that i typed the following command at the shell
prompt
shell # mysqlimport -u root -p webcalendar tables-mysql.sql
where, 'webcalendar' is the database that i have created for this
purpose. after entering the password at the password prompt it is
displaying the following error:
mysqlimport: Error: You have an error in your SQL syntax near
13 matches
Mail list logo