473,408 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

OT : MySQL and OUTFILE

All,
I have an app that creates a text file of ip addresses, in text format, 1 ip
per line, i.e.

10.10.10.10
10.10.10.15
10.10.10.20
etc.

I am trying to get MySQL to dump out info from the db in the same format,
however, it creates the file with each address on 1 line, i.e.
10.10.10.10|10.10.10.15|10.10.10.20|etc <-- note the | character is a tab
in the output file

I use a batch file to run mysql from the command line, which calls the SQL
statement from an external file.

//batch file
mysql -hlocalhost -uroot -ppassword --database=db < ip.sql

//contents of ip.sql
SELECT ip INTO OUTFILE 'ip_dump.txt' FROM iptable

Any ideas ? Missing mysql parameters ?
Thanks.
Jul 17 '05 #1
1 1939
Well,
I was able to use LINES TERMINATED BY and line breaks were created, however,
I have a new problem now.
The original file is created via WriteLine and each entry is on its own
line, and is read in via ReadLine. The MySQL text file, even though it
contains \n's, doesn't read properly into the .NET app.

So, I need to update the .NET app now to correctly handle \n's instead of
relying on each entry on its own line. Argh.
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jason Reljac | last post by:
Howdy, I'm looking for a little help. I had a W2K server with Apache/PHP/mySQL installed and working. I had a specific page that ran a mySQL SELECT INTO OUTFILE and dumped the outfile into a...
7
by: atlasyeo | last post by:
Hi, my first time posting on a newsgroup. anyway, let's cut to the chase. I'm trying to migrate mysql database form one server to another server. So I copied the data from /var/lib/mysql to the...
5
by: sandy | last post by:
Hi All, I am a newbie to MySQL and Python. At the first place, I would like to know what are the general performance issues (if any) of using MySQL with Python. By performance, I wanted to...
4
by: Ka | last post by:
I install a mysql server in default installation with latin charset, but I want to use GBK(a chinese charset), so that I can store and search chinese words directly. so, I download, unpack and...
0
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
0
by: Jason Reljac | last post by:
Howdy, I'm looking for a little help. I had a W2K server with Apache/PHP/mySQL installed and working. I had a specific page that ran a mySQL SELECT INTO OUTFILE and dumped the outfile into a...
2
by: solartimba | last post by:
Hi, I am in another country, and I need to finish a program. But I do not have any reference books. Can you tell me how to print this to a file without ending the stream with an endl. Stated...
1
by: Shiraz | last post by:
i did "select * into outfile 'data.sql' from CDRS" to backup my data. what is the reverse to get the data back in? it looks liek the fields are delimited by tabs in the file. tjanks
10
by: Simon | last post by:
Hi, I need to export a 200MB database from one domain to another. phpMyAdmin timeout after a while and is not ideal. I don't mind spending money if I have to but this is rather urgent. I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.