Solved

How to remove double-quotes when writing to a text file?

Posted on 2003-12-03
4
645 Views
Last Modified: 2013-12-18
Hi all,

I have a program to write the content of a document to a text file when the user clicks on a button.

Here is a part of the program:

fileNum = Freefile()
fileName = "C:\Sample.txt"
Open fileName For Output As fileNum
tmpContent = doc.P1(0) +"|"+ doc.T1(0) +"|"+ doc.DSO1(0) +"|"+ doc.DO1(0) +"|"+ doc.PS1(0) +"|"+ doc.PSG1(0) +"|"+ _
doc.RS1(0) +"|"+ doc.PO1(0) +"|"+ doc.POG1(0) +"|"+ doc.RO1(0) +"|"+ doc.S1(0) +"|"+ doc.OI1(0) +"|"+ doc.CL(0)
Write #fileNum, tmpContent
Close fileNum

However, after writing to the text file, the content in the text file is wrapped by "double-quotes", eg. "abc|def|ghi|jkl|mno|pqr".
How can I remove the double-quotes?

Thanks very much in advance!

kspuea
0
Comment
Question by:kspuea
  • 2
4 Comments
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 9871517
Try opening the file for BINARY access.
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 9871529
Also, declare tmpContent as String explicitly.
0
 
LVL 31

Accepted Solution

by:
qwaletee earned 50 total points
ID: 9871620
Hi jjperez2,

Replace the "WRITE" statement with a "PRINT" statement, like so:

Print #fileNum, tmpContent

The WRITE statment always uses delimiters:
Write # statement  

Writes data to a sequential text file with delimiting characters.

Numeric      Omits leading and trailing spaces.
String      Encloses all strings in double quotation marks. Pads fixed-length strings with spaces as needed.



Best regards,
qwaletee
0
 

Author Comment

by:kspuea
ID: 9871807
Hi qwalette, thanks very much! Your method works wonderfully!
Finally I solved my problem.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now