Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unwanted spaces
Hi,
I am using the Open statement to load a file for input, and an Print# statement to output to a different text file. Open ("C:\Documents and Settings\millarg\Desktop\result.txt") For Output As #2 T$ = Chr$(9) Print #2, "Year"; T$; "Month"; T$; "Day"; T$; "Rain"; T$; "Lat"; T$; "LongTd" This particular part of code puts a heading line in the file. I then go on to open the Input file, and do various tests. However, later on when I print actual data, I get unwanted spaces between tab characters. T$ = Chr$(9) If Yr = MyYear And mnth = _ MyMonth And dy = MyDay Then Print #2, Yr; T$; mnth; T$; dy; T$; Rain; T$; MyLat; T$; MyLong Close #1 GoTo BackUp Else: Input #1, Yr, mnth, dy, cumday, Rain, MyLat, MyLong End If Yet, if I test variables such as Yr, mnth or dy while code is running, there are no spaces in these variables. But printing them, even if forcing a tab character, results in spaces. Following si an example of an output: Year Month Day Rain Lat LongTd 1975 12 21 152 148.10 23.95 1978 2 1 155.1 148.10 23.95 2002 1 5 198.6 148.10 23.95 When I paste it in here, there is only one character in the heading row, equal to a tab in the original file. But there are multiple characters in the actual data, which did not come from the original data. Is there some way around this, or a test I can do to get rid of these unwanted spaces? Any ideas? -- Regards, Glen Millar Microsoft PPT MVP http://www.powerpointworkbench.com/ Please tell us your ppt version, and get back to us here Remove spaces from signature Posted to news://msnews.microsoft.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unwanted spaces in merged cells | Excel Discussion (Misc queries) | |||
remove unwanted spaces? | Excel Worksheet Functions | |||
Deleting unwanted lead spaces throughout a worksheet | Excel Worksheet Functions | |||
Unwanted spaces | Excel Worksheet Functions | |||
how do I remove leading spaces and leave the remianing spaces w | Excel Worksheet Functions |