Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2003-12-03
4
Medium Priority
?
697 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 200 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

670 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