Right Justified Text Export

exo

Registered User.
Local time
Today, 11:39
Joined
May 21, 2009
Messages
23
I have been searching for solutions to this problem, yet all I have found are little work arounds - nothing that directly addresses the issue.

I have a file that we import using another program. I have written an import spec to bring it into access where I will prune out some entries.

At this point I plan to export the text file back out, although it needs to be aligned the same way it came in.

Now, access seems to want to make everything left justified, so the export file does the same thing.

Since the numbers in the original file can be of different lengths, I can not set the import/export spec to be left justified - as I may cut off a leading number.

The primary answer I have seen is to set the format to produce leading zeros. The problem with this is that leading zeros run the risk of messing up the import program which expects just the number - and not leading zeros.

What I need, quit simply, is for access to put the numbers on the right side during the export. Is this simply not possible?
 
I have been searching for solutions to this problem, yet all I have found are little work arounds - nothing that directly addresses the issue.

I have a file that we import using another program. I have written an import spec to bring it into access where I will prune out some entries.

At this point I plan to export the text file back out, although it needs to be aligned the same way it came in.

Now, access seems to want to make everything left justified, so the export file does the same thing.

Since the numbers in the original file can be of different lengths, I can not set the import/export spec to be left justified - as I may cut off a leading number.

The primary answer I have seen is to set the format to produce leading zeros. The problem with this is that leading zeros run the risk of messing up the import program which expects just the number - and not leading zeros.

What I need, quit simply, is for access to put the numbers on the right side during the export. Is this simply not possible?

It appears that all fields are being considered as datatype text on the import.
If you're creating an import spec, do a small test-
and change the datatype to Number or Integer. Text is left-justified, numbers are right-justified.
Just my $.02
 
Thanks for the input.

Using either single or double modifies my original numbers by adding decimal places.

using integer right aligns it within the database, but it is still left aligned on export.

It seems that the problem is not how access stores the data within the table, but that access insists on exporting a field to the right side of a fixed width area, rather than the left.
 
Hi,

I suggest you create a VBA procedures that will loop through a recordset. You will then be able to write the output file exactly as you need it. I did that a lot and that's the best way to get a "custom" output.

Simon B.
 

Users who are viewing this thread

Back
Top Bottom