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

Write statement 2

Status
Not open for further replies.

finitesimian

Programmer
Feb 11, 2006
29
0
0
US
I'm trying to make a script that writes to a txt file on my desktop. I've figured out the script for opening/closing and writing to the txt document, but I'm needing it to do a couple of other things:


1. write each new expression to a new line (next line down) instead of overwriting the existing occupied lines on the .txt file.

2. If possible, write without quotation marks/delimiting characters.


also-- I could have sworn I saw a code here a while back for writing to an open document, but I was never able to find that thread.
 
Post your code

1. write each new expression to a new line (next line down) instead of overwriting the existing occupied lines on the .txt file.
Open FName$ For Append As FNum%
should do it.

2. If possible, write without quotation marks/delimiting characters.
post your code
also-- I could have sworn I saw a code here a while back for writing to an open document, but I was never able to find that thread.
What type of document?

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
Thanks for the tip :)

Here is one example

Code:
Dim op1 As String 
op1 = "This is my output"
Open "C:\Documents and Settings\myuserprofile\Desktop\scrape.txt" For Append As #1
    Write #1, op1 
    close 1

I want it to write: This is my output instead of "This is my output" (no quotation marks anything-- just the string by itself)

-----
As for which kind of document, it's a .txt file.

 
Use Print #1 instead of Write #1 to not have quotes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top