Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / May 2008

Tip: Looking for answers? Try searching our database.

Access Export Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
leejinhoo@gmail.com - 09 May 2008 15:59 GMT
Hi All,

I have a quick question about Access. I know in Access you can export
the database into txt file (and choose which fields go to which
space). However, the numbers in the txt file are all "align left".
Would you please tell me how to do it in "align right"? Many Thanks!

e.g.
The txt file is like this:
A____1___34567.10___222.10
A____2___123.10_____45677.10

This is what I want:
A____1____34567.10_____222.10
A____2______123.10___45677.10
Jerry Whittle - 09 May 2008 17:03 GMT
I'm assuing that you are exporting as fixed width. It can be a pain to do.

For the number fields you can do something like below in a query then export
the query. Make sure that the number, like 9 below, is large enough to hold
the largest number. With a query you can chose the fields and their order.

AmtPadded: String(9-Len([Amt])," ") & [Amt]

However Access has a bad habit of looking at the original field size and
cutting things off there. In that case you need to go to the Advanced button
during the Export wizard and make the width larger for those fields. If the
number is in the middle of the query, you'll need to do the math and make all
the columns fit properly.
Signature

Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

> Hi All,
>
[quoted text clipped - 11 lines]
> A____1____34567.10_____222.10
> A____2______123.10___45677.10
Pete D. - 10 May 2008 00:18 GMT
Not possible, text files don't have alignment.  Many editors fake this
feature with tabs but when saved as txt file the tabs are padded with space
character.  You could duplicate this feature with VBA padding field lengths
but why would you.  Use comma separated values and then you can open it in
excel, access restored to cells or fields.  I am curious as to how it aligns
like your showing as columns don't usually align like that unless you are
already padding them with spaces.

This would be more normal
A    1      123     12321
B    2       12345    1233

> Hi All,
>
[quoted text clipped - 11 lines]
> A____1____34567.10_____222.10
> A____2______123.10___45677.10
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.