write in txt file in tabular mode

User avatar
sal21
PlatinumLounger
Posts: 4362
Joined: 26 Apr 2010, 17:36

write in txt file in tabular mode

Post by sal21 »

I use this code to print data in txt file... and have:

Code: Select all

While Not RS.EOF
For I = 0 To RS.Fields.Count - 1
Print #1, RS.Fields(I).Value
Next I
wend
aa
bb
cccc
dddd
ffff
ff
h
....

i need to write in txt file in tabula mode similar:

aa bb cccc dddd ffffff ff h
aa bb cccc dddd ffffff ff h
aa bb cccc dddd ffffff ff h

...

aa bb cccc dddd ffffff ff h

naturally maintain the same space from data...

how to?
Last edited by sal21 on 08 Sep 2011, 09:36, edited 1 time in total.

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: write in txt file in tabular mode

Post by HansV »

How do we know where to start a new line?
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4362
Joined: 26 Apr 2010, 17:36

Re: write in txt file in tabular mode

Post by sal21 »

HansV wrote:How do we know where to start a new line?
SORRY...
modified my original post... :grin:

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: write in txt file in tabular mode

Post by HansV »

Doesn't the database system you're using have an option to export to a fixed width text file?
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4362
Joined: 26 Apr 2010, 17:36

Re: write in txt file in tabular mode

Post by sal21 »

HansV wrote:Doesn't the database system you're using have an option to export to a fixed width text file?
TKS suggestion but resolved with other code.
:thankyou: