Solved

Tab Delimited export from vb.net

Posted on 2009-05-11
6
429 Views
Last Modified: 2012-05-06
I need to know why my code is not recognizing vbTab when exporting to a file.
logtxt1 = Item0 & vbTab & RTrim(Item1) & vbTab & RTrim(Item2) & vbTab & RTrim(Item3) & vbTab & RTrim(Item4)
            logtxt1 = logtxt1 & vbTab & RTrim(Item5) & vbTab & RTrim(Item6) & vbTab & RTrim(Item7) & vbTab & RTrim(Item8)
            logtxt1 = logtxt1 & vbTab & RTrim(Item9) & vbTab & RTrim(Item10) & vbTab & RTrim(Item11) & vbTab & RTrim(Item12)
            logtxt1 = logtxt1 & vbTab & RTrim(Item13) & vbTab & RTrim(Item14) & vbTab & RTrim(Item15) & vbTab & RTrim(Item16)
            logtxt1 = logtxt1 & vbTab & RTrim(Item17) & vbTab & RTrim(Item18) & vbTab & RTrim(Item19) & vbTab & RTrim(Item20)
            logtxt1 = logtxt1 & vbTab & RTrim(Item21) & vbTab & RTrim(Item22) & vbTab & RTrim(Item23) & vbTab & RTrim(Item24)
            logtxt1 = logtxt1 & vbTab & RTrim(Item25) & vbTab & RTrim(Item26) & vbTab & RTrim(Item27) & vbTab & RTrim(Item28)
            logtxt1 = logtxt1 & vbTab & RTrim(Item29) & vbTab & RTrim(Item30) & vbTab & RTrim(Item31) & vbTab & RTrim(Item32)
            logtxt1 = logtxt1 & vbTab & RTrim(Item33) & vbTab & RTrim(Item34) & vbCrLf
            My.Computer.FileSystem.WriteAllText(Filename, logtxt1, True)

Open in new window

0
Comment
Question by:larrystewart
6 Comments
 
LVL 48

Expert Comment

by:jpaulino
ID: 24359572
Why ? It should work.
0
 
LVL 11

Expert Comment

by:Muhammad Ousama Ghazali
ID: 24359789
Try using Chr(9) instead.
0
 
LVL 11

Expert Comment

by:Muhammad Ousama Ghazali
ID: 24359804
See this link: http://msdn.microsoft.com/en-us/library/f63200h0.aspx

What I understand and had experienced is written there on the above page. The constants are good for Print and Display and may not be good for writing to files so it is always better to use the equivalent provided.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:larrystewart
ID: 24359805
I have tried chr(9). I need to look further into this.
thx
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 24359890
What are you reading the output file with?...
0
 

Author Closing Comment

by:larrystewart
ID: 31580343
It was what I was using to display my output. The code was working correctl;y. thank you
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question