RE: Export Table to fixed length txt file
- From: Jack Leach <dymondjack at hot mail dot com>
- Date: Thu, 23 Apr 2009 09:50:15 -0700
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
- References:
- Export Table to fixed length txt file
- From: David
- Export Table to fixed length txt file
- Prev by Date: Re: looping through recordset
- Next by Date: RE: Print to PDF in VBA Code
- Previous by thread: Export Table to fixed length txt file
- Next by thread: SQL issue with "either true or false"
- Index(es):
Relevant Pages
|