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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text file and aligment

Status
Not open for further replies.

jshanoo

Programmer
Apr 2, 2002
287
IN
Hi,
I have to create a text file as mentioned below,
strline=(int1 + 1) & vbtab & <name> & vbtab & <phone> & vbtab & <date> & vbtab & <time>
But soemtimes due the irregulat length of strings, it goes way ward or isnot getting in proper aligment.
-----------------------------------------
1 MR SANTOSH PARADKAR 25276952 15/05/2003 12:03
paradkarsantosh@hotmail.com WATER COOLER-BLUE STAR
2 MS RITU 55977195 16/05/2003 12:44
ritupande@hotmail.com Water Heater
-----------------------------------------------------------------------

Can any one please help me to solve this
Regards
John Philip


*** Even the Best, did the Bad and Made the Best ***

John Philip
 
Not sure what your real problem is. what do you want to use the file for ?

1. If you want a text file to transfer data to another application, the fact that it does not look correct in a text editor is not important.

2. If you want to see columns aligned in a normal text editor, which has no control over column width, then you will have to check the string length and add additional tabs as necessary - as you would when typing.

3. If you want to view the output in Word then a single tab will suffice because you are able to set the tab position where you like - or better still import into a Word table.



Regards
BrianB
** Let us know if you get something that works !
================================
 
Assuming your writing the string to a TXT file, try changing that to a CSV. Excel will autoparse this into columns for you when opened.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top