Link to home
Start Free TrialLog in
Avatar of gollem
gollem

asked on

Write to textfile problem

Hi,

this is the problem I have:

I wrote a little program to write some data to a textfile.

Open "g:\transfer\convertedADBsap.txt" For Output As #1
...
Write #1, strDatum & strKey & strDescription
...
Close #1

This program works great but when I look in the created textfile(with notepad) I see:

"20040731 1 test"

I would like to become 20040731 1 test without the " ".  Is this possible? Suggestions?

Thanks
Avatar of JR2003
JR2003

Write #1, Trim(strDatum) & Trim(strKey) & Trim(strDescription)
ASKER CERTIFIED SOLUTION
Avatar of mladenovicz
mladenovicz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry I misunderstood.

Dim strText as String
strText = strDatum & strKey & strDescription
strText = Right(strText, Len(strText) - 1)
strText = Left(strText, Len(strText) - 1)
Write #1, strText
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gollem

ASKER

Hi,

thanks guys exactly what I needed.  I'll give the points to mladenovicz because he had the fastest solution first, but I'll add 20 points for dhaest for his great comment.

JR2003 I've tested your solution but I still get " " in my textfile.

The print statement was the key I needed.

Thanks again for your time and quick reply.

Gollem