Sponsored Content
Top Forums Programming Load text file into a MySQL field Post 302238464 by Franklin52 on Saturday 20th of September 2008 06:47:36 AM
Old 09-20-2008
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to insert data into MYSql database from a text file

Hi, Need to get help from you guys about this issue. I need to insert data into MySql database from a text file which is located in other server. The text file is something look like below: Date | SubscriberNo | Call Duration 20/7/07 | 123456788 | 20 20/7/07 | 123412344 | 30 The... (4 Replies)
Discussion started by: shirleyeow
4 Replies

2. Shell Programming and Scripting

Perl script to load text file into DB field

Hello, maybe this post is offtopic, sorry for the inconveniencies (maybe should be in the forum with questions about C, C++, Java, SQL...). I found examples about how to populate different fields from a text file (with MySQL, the LOAD DATA INFILE sentece), but not about how to load a complete... (2 Replies)
Discussion started by: aristegui
2 Replies

3. Shell Programming and Scripting

shell script to read data from text file and to load it into a table in TOAD

Hi....can you guys help me out in this script?? Below is a portion text file and it contains these: GEF001 000093625 MKL002510 000001 000000 000000 000000 000000 000000 000001 GEF001 000093625 MKL003604 000001 000000 000000 000000 000000 000000 000001 GEF001 000093625 MKL005675 000001... (1 Reply)
Discussion started by: pallavishetty
1 Replies

4. Shell Programming and Scripting

load a data from text file into a oracle table

Hi all, I have a data like, 0,R001,2,D this wants to be loaded into a oracle database table. Pl let me know how this has to be done. Thanks in advance (2 Replies)
Discussion started by: raji35
2 Replies

5. Shell Programming and Scripting

executing mysql load statement from shell script

Hi, I have a piece of shell script which will connect to mysql database and execute a load statement(which will load datas in a file to the database table).The code is working and the data is in the tables. Now my requirement is, i need to grab the output from the load statement... (4 Replies)
Discussion started by: DILEEP410
4 Replies

6. Shell Programming and Scripting

sh and MySQL LOAD DATA

I have a csv file in a folder that is roughly 500,000 rows long. Rather than using PHP, I would like to use SH to run a MYSQL LOAD DATA command to load the data in, as I think it would be much faster and would not cause any memory problems associated with PHP. But the problem is, I am not... (18 Replies)
Discussion started by: worchyld
18 Replies

7. Solaris

Mysql query reading a text file.

Hi, Is there any way that mysql query reads the content from a text file which has data in the below format: 1,2,3,4,5 and selects matched data from another table. ie I have a table named xyz which has same ids as in that file. I want this query to get count of the ids from xyz file by... (6 Replies)
Discussion started by: jyothi_wipro
6 Replies

8. Shell Programming and Scripting

Text file -> fixed column -> MySQL DB

Hi ! I have searched in the forum, but i'm not able to combine various solution to help me ! My problem is very simple for a bash scripter or a old linux man, but not for me (novice and inexperienced). I need to store in a mysql database the output of "last" command, but the table where i need... (2 Replies)
Discussion started by: axl936
2 Replies

9. UNIX for Beginners Questions & Answers

How to write MySQL query in text file and run in Linux?

I would like to call a .sql file from a .sh file in linux. The .sql file will contain queries to MySQL database. I am able to call the .sql file by running .sh file in linux, but the sql query is not working. Below is my syntax. The select statement is throwing below error. ./sample.sql: line... (1 Reply)
Discussion started by: qytan
1 Replies
DBF2MYSQL(1)						      General Commands Manual						      DBF2MYSQL(1)

NAME
dbf2mysql, mysql2dbf - convert between xBase and MySQL databases SYNOPSIS
dbf2mysql [-v[v]] [-f] [-u|-l] [-n] [-o field[,field]] [-e conversion-file] [-s old-name=new-name[,old-name=new-name]] [-i field[,field]] [-d database] [-t table] [-c[c]] [-p primary] [-h host] [-F] [-q] [-r] [-x] [-P password] [-U user] dbf-file mysql2dbf [-v[v]] [-u|-l] -d database -t table [-h host] [-q query] [-P password] [-U user] dbf-file DESCRIPTION
dbf2mysql takes an xBase file and sends queries to an MySQL server to insert it into an MySQL table. mysql2dbf dumps a MySQL table to a dbf file. OPTIONS
-v Produce some status output. -vv More verbose. -vvv Even more verbose: produce a progress report. -f Translate all field names in the xBase file to lowercase. -u Translate all text in the xBase file to uppercase. -l Translate all text in the xBase file to lowercase. -n Allow NULL fields: 'NOT NULL' will be not added in table creation statement. -o field[,field[,...]] List fields to insert into MySQL database. Primary use is to ease import of complex dbf files where we want only few fields. NOTE: -o is processed before substitution (-s), so you have to use dbf field names here. -e conversion-file Specify file for CHAR fields conversion. File format is: 1st line: number of characters to convert (number of lines). Further lines: <char_to_convert> <char_after_conversion>. -s old-name=new-name[,old-name=new-name[,...]] Takes a list of field name/new field name pairs. Primary use is to avoid conflicts between field names and MySQL reserved keywords. When the new field name is empty, the field is skipped in both the CREATE clause and the INSERT clauses, i.e. it will not be present in the MySQL table. For example: -s ORDER=HORDER,REMARKS=,STAT1=STATUS1 -i field[,field[,...]] List fields to be indexed. MySQL field names should be used here. -d database Select the database to insert into. Default is 'test'. -t table Select the table to insert into. Default is 'test'. -c[c] Create table if one doesn't exist already. If the table already exists, drop it and build a new one. The default is to insert all data into the named table. If -cc is specified, no records will be inserted. -p primary Select the primary key. You have to give the exact field name. -h host Select the host to insert into. Untested. -F Fixed length records. (By default CHAR is saved as VARCHAR.) -q dbf2mysql: "Quick" mode. Inserts data via temporary file using 'LOAD DATA INFILE' MySQL statement. This increased insertion speed on my PC 2-2.5 times. Also note that during whole 'LOAD DATA' affected table is locked. mysql2dbf: Specify custom query to use. -r Trim trailing and leading whitespace from CHAR type fields data. -x Start each table with _rec and _timestamp fields. -P password Specify password on the MySQL server. -U user Specify user on the MySQL server. BUGS
mysql2dbf can't write MEMO files at this time. Possibly incorrect field lengths for REAL numbers. AUTHORS
Originally written by Maarten Boekhold <boekhold@cindy.et.tudelft.nl>, Oct 1995. Patched for MySQL by Michael Widenius <monty@analytikerna.se>, 3 Nov 1996. Manual page written for Debian GNU/Linux from README by Heiko Schlittermann <heiko@lotte.sax.de>, Aug 1997; updated by Matej Vela <vela@debian.org>, Nov 2001. COPYRIGHT
Use this piece of software as you want, modify it to suit your needs, but please leave my name in place ok? :) DISCLAIMER
The authors do not accept any responsibility for possible damage you get as result of using this program. Debian Project 2001-11-18 DBF2MYSQL(1)
All times are GMT -4. The time now is 03:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy