473,410 Members | 1,977 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,410 software developers and data experts.

query / data extraction into outfile help

1
Hi All,
Thanks for taking the time to read this post, I appreciate it.

Two problems

Problem 1
---------
I need help with a query the table contains 35 odd columns I only want fname, lname,and age . I'd like to dump the results as a single file in the following format:
fname:lname:age
As after I have dumped the results I need to import them into another app that uses the format fname:lname:age .
I'm sure this can be done but need some pointers.

Problem 2
---------

A similar issue , this time I have database dumps in table.sql format. Again I need to extract the columns fname,lname,age into another file and alter the format to fname:lname:age .
Am I going to have to import the data into a temporary table then extract it or can i extract the information directly.
I've been doing it with excel as it's the only tool I know but with 20-30k records it's a pain.

G'wan folks I know you can help.

Best
b0red
Jan 29 '07 #1
1 1955
ronverdonk
4,258 Expert 4TB
You can extract the values into an output file, like
Expand|Select|Wrap|Line Numbers
  1. SELECT fname,lname,age FROM table INTO OUTFILE 'fn.ft'
  2. FIELDS TERMINATED BY ':' LINES TERMINATED BY '\n'; 
Your second problem: unless you want to write a program to change your .sql file, I advise to just execute the .sql file into a temp table, and do a similar SELECT as above.

Ronald :cool:
Jan 29 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Joan | last post by:
I read RAW image data from a binary file stream. I have to read just bytes one by one and put them into a matrix of structs of unsigned chars. I have to use unsigned chars because their rangs go...
1
by: Charlie | last post by:
Hello, I have data in an Access table that I would like to export to multiple HTML tables. I would like to split the data in the Access table (about 92,000 records) into multiple HTML...
13
by: Robert S | last post by:
hello, I am investigating a code,which has data struct deelacration as follow: typedef struct { char *infile; char inoptsbuf; char *outfile; } cmdoption_a; cmdoption_a *cmdoption;
2
by: Jason Huang | last post by:
Hi, Would someone show me how to do the data extraction to Excel in ASP.Net using C# web form? I am not familiar with VB, so I am asking someone to help me out! Any help will be appreciated. ...
0
by: wuzertheloser | last post by:
Define the file-pointers *Infile and *Outfile and link them to a given input file Sale.dat (which is in the homework/directory) and the output file Comm.dat (which you will create in this...
1
by: gator6688 | last post by:
I need to be able to save my additional data to my .dat file. The additional data is not part of the vector though. It is data I made after the vector. I have to save the finalGrade and letter grade...
10
by: rory | last post by:
I can't seem to append a string to the end of a binary file. I'm using the following code: fstream outFile("test.exe", ios::in | ios::out | ios::binary | ios::ate | ios::app)...
5
by: bobh | last post by:
Hi All, Is there a difference in preformance between the two; TblNme has 36 fields across a record a query that selects all fields and the report only uses 75% of the fields, ie; Select...
9
by: Sinner | last post by:
Hi, I have a field name 'USER' in tableMAIN. How do I replace the user names with corresponding user names. I can do that in xl using vlookup but now I'm trying to find a way to do that in...
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?
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.