RE: Export Table to fixed length txt file



This may not be the best solution, but it should do the trick.

Make a temp table with all text fields set the the fixed length you require.

Run an query to populate the temp table from your main table (include any
conversion functions required).

Run a query to update the now populated temp table setting the format to fix
the length of string to what you require.

You would ideally now have a table that has all of the data in string
format, formatted to fixed lengths, and an export from there to your text
file should do it.

I don't know the details off the top of my head, but I know it's possible to
do each step, so you could try it like that. Don't expect it to be very
quick though.

hth


--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)



"David" wrote:

I have three tables- a header (10 columns- 1 row)- main body (40 columns-
many rows) and a trailer (12 columns - one row)

I need to export all three to fixed length text file where the end of line
character needs to be in a particular position (different for the three
elements) say position 1500 for the main body- 250 for the header / trailer
Any help in best way to joing them to one txt file in format required would
be great.
--
Thanks for your help
.



Relevant Pages

  • Re: Adding a new file extension for Pipe Delimited files
    ... Dim Temp As String ... Dim FileNumber As Long ... open and handle like CSV files? ... allow me to keep the pipe delimited format. ...
    (microsoft.public.excel.programming)
  • Temp Database problems with Access 2007
    ... I've been using Tony Toew's Temp table module and I've now upgraded to ... The database is still in 2003 format. ... ' This subroutine illustrates how to use a temporary MDB in your app. ...
    (comp.databases.ms-access)
  • Re: Best way to import text file into existing table on a daily ba
    ... file, temp table, and permanent table). ... table's field when you run an append query that appends that data item into ... If you need the input mask's format applied to the data for the ...
    (microsoft.public.access.externaldata)
  • Re: converting to FLOATING_POINT..
    ... Then, the max widths for each column are used in the sprintf function, (which uses a '*' as a placeholder, if thats an accurate term for the ... push @temp, $temp; # incorrect ... The format should be applied at this point so that that when the max_length is calculated below, the width of each $time and $temp variable will be as it will be when printed out. ...
    (perl.beginners)
  • Re: This is weird: Pop works but shift doesnt
    ... >> I'm parsing a log file that contains this format: ... >> push @temp, $time; ...
    (perl.beginners)