473,771 Members | 2,328 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

query / data extraction into outfile help

1 New Member
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 1969
ronverdonk
4,258 Recognized Expert Specialist
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
4760
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 from 0 to 255. If I use chars then a value of 129 will be -128 :( The problem: infile.get(ImageDATA.R);
1
6602
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 tables/files to reduce download time and bandwidth usage on my web server. That way, the user can select a particular page to download instead of downloading a page with all of the records. I would like to set a limit of only 500 records per file.
13
1332
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
2974
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. Jason
0
1656
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 assignment). Use while(fgets()!=NULL) to read all the lines in Sale.dat. For odd number lines (containing full names) sscanf name and surname, print the full name on the screen and in the output file Comm.dat. For even number lines (with amount of sale),...
1
1569
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 to my file.Also, how can I save my letter grade to my file when I didn't actually name it that? #include "stdafx.h" #include <iostream> #include <fstream> #include <string> #include <cstdlib> #include <iomanip> #include <cmath> #include...
10
22747
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) outFile.write("teststring", 10); outFile.close(); If I leave out the ios::ate and ios::app modes my string is written to the start of the file as I'd expect but I want to write the data to
5
1468
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 TblNme.* where OffCde='123' or
9
3635
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 access. For a user mismatch, it should give NA Thx.
0
9619
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9910
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7460
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.