Results 1 to 3 of 3

Thread: [RESOLVED] print a sentence to txt file

  1. #1

    Thread Starter
    Lively Member chxxangie's Avatar
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    79

    Resolved [RESOLVED] print a sentence to txt file

    <?xml-stylesheet type="text/xsl" href="xsl_log file.xsl"?>

    i want to put above sentence in a 1st line of text file.....
    how to write the code?

    open "C:\aa.txt" for append as #1
    print #1,"<sentence put here>"
    close #1

  2. #2
    Fanatic Member amrita's Avatar
    Join Date
    Jan 2007
    Location
    Orissa,India
    Posts
    888

    Smile Re: print a sentence to txt file

    Write this.

    Print #1, "<?xml-stylesheet type=""Text / xsl"" href=""xsl_log file.xsl""?>"

  3. #3
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: [RESOLVED] print a sentence to txt file

    Open for Output. Open for Append opens an exosting file and puts what you print at the bottom.

    If you want to print something to the first line of an existing file, you'll have to read the entire file, add the new sentence at the beginning, and priont the whole thing to the file. You can't insert text in an existing text file.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width