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

Export Multiple Tables into Fixed Width TXT file Sorted

Hi all,

Took a CSV file which was then imported into a temporary table. Separated the initial table into 3 tables with width defined for each field.

Now need to export data into one TXT file.

Example:
01table one detailshere
02table two detailshere
03table thre detailshere
01next record deatilshere
02next record detailshere
03
01

I cannot combine them into one table as the width is not the same, so thinking i need to use VBA with a SQL statement.

Ultimately just used access/tables for temporary storage for reformatting the CSV file.

Any help greatly appreciated.
Thanks in advance!
Feb 25 '13 #1
5 2184
Rabbit
12,516 Expert Mod 8TB
You can use a union query and then just use the largest width.
Feb 26 '13 #2
Thanks for the response, problem is, that it needs to come out as a fixed width with the proper field length.

01ACCT# PATNAMEPAT ADDRESS.......
02ACCT# GUARNAMGUARANT ADD.....
03ACCT# INSNUMBERINSNAME....
01ACCT2 PATNAMEPAT ADDRESS.......
02ACCT2 GUARNAMGUARANT ADD......
03ACCT2 INSNUMBERINSNAME....01ACCT# 01ACCT3 PATNAMEPAT ADDRESS.......
02ACCT# GUARNAMGUARANT ADD......
03ACCT# INSNUMBERINSNAME....

I hope that helps a bit more
Feb 26 '13 #3
Rabbit
12,516 Expert Mod 8TB
I know. That's why you should use a union query and then use the largest width of the mutliple queries to create your fixed width.
Feb 26 '13 #4
Sorry for the late response as I had to go out of town. Problem with the Union is that the columns do not match.
Feb 28 '13 #5
Rabbit
12,516 Expert Mod 8TB
If the columns don't match, then you no longer have a fixed width text file. You just have a text file of text with no way to discern what field is what.
Feb 28 '13 #6

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

Similar topics

0
by: m00nm0nkey | last post by:
Hello! Using this MSDN Page as a reference - http://tinyurl.com/abkky - I am trying to create an instance of Excel, Import a fixed width file and save the file as an Excel Spreadsheet, in...
4
by: Paolo | last post by:
Friends, I need help with some code to export different tables to a single spreadsheet in Excel. My excel file is named REPORT and the spreadsheet is named CLIENTS. I do have the code to export...
5
by: Reggie | last post by:
Hi and TIA! I have a query that I want to save as a fixed-width text file. I can get the export to work using an export specification with one exception. This is a government message and they need...
0
by: gelangov | last post by:
I want to export a table into a "fixed width" file using SQL 2005 import export wizard. This is the version I have: SQL Server 2005 - 9.00.2047.00 For some reason it joins all the rows...
0
by: Vinny | last post by:
i'm not sure if this is the right group for this message, if not, i apologize. i have an application i'm writing which needs to bulk-load several million records into an sql server table. i'm...
10
by: BostonNole | last post by:
Using Visual Studio 2005, .NET 2.0 and VB.NET: I am looking for the fastest possible way to import a very large fixed width file (over 6 million records and over 1.2 GB file size) into a...
0
by: Max | last post by:
Hi I am trying to export an Access table to a fixed-width text file. The table contains 2 memo fields of approx. 1000 characters each. I am using the 'Export text wizard' to export. In this...
1
by: peridian | last post by:
Hi, Quick question, I have a fixed width text file with over 1000 fields in it that I need to get into SQL Server 2000 (I have both enterprise manager and management studio). I have an excel...
2
by: dileshw | last post by:
hey guys, I have a access (2000 format) database. I want to be able to export all the tables in it onto a single .xls file and import it from an identical .xls file (for example if i email the...
6
by: srikanya | last post by:
Hi, I have a database with 10 tables and I want to export all table data into excel file.But there should be only one excel file with different sheets in it, each containing different tables data.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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
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...
0
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...
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,...

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.