Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi Line output of export

Status
Not open for further replies.

BDW1969

IS-IT--Management
Aug 29, 2002
43
0
0
US
I am trying to export records out into a txt file. I am not sure how to get this done. I need the txt file to look like the example below assuming there were just 2 records. I am doing this comma delimited.

POL ......X
INS ......X
VEH ......X
POL ......X
INS ......X
VEH ......X
 
I'm a bit fuzzy about your requirement. You say "... comma delimited ..." but there are no commas in your example. You also say "... two records ..." but I see six lines. Is this
[tt]
POL ......X
INS ......X
VEH ......X
[/tt]
one record?

Are the [tt]"......"[/tt] strings literal? (i.e. is that what is to appear?) or do they represent some other structure that you are not showing?


 
Yeah two records that would be broken into three different lines each. I didn't show the commas as I assumed that the would be understood.
 
The commas are understood. Their placement is not. Is it
[tt]
POL ......X,
INS ......X,
VEH ......X
[/tt]
or
[tt]
POL, ......X
INS, ......X
VEH, ......X
[/tt]
or ???

Depending on what you have for a data source, you could do something like
Code:
Dim nH As Integer
nH = FreeFile
Open "myTextFile.txt" For Output As #nH

Print #nH, "POL ......X" & vbCrLf & _
           "INS ......X" & vbCrLf & _
           "VEH ......X" & vbCrLf

Close #nH
And place your commas where you need them.
 
Sorry about that, I have a more precise example below.

"POL","20060310","33855","2","FL",,"2",,"X"
"INS","ATLANTICTRUCK LINES, INC.","X"
"VEH","ATLA, INC.","X
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top