Inserting text in file using FSO

Results 1 to 2 of 2

Thread: Inserting text in file using FSO

  1. #1
    Join Date
    Dec 1969

    Default Inserting text in file using FSO

    Is it possible to insert text into a file, using the File System Object, at a specific point in the file without overwriting the text that follows?<BR><BR>If yes, how?<BR><BR>Also is it possible to create an ASP page using FSO even adding the &#060;% %&#062; in the textstream? I can&#039;t get this to work either.<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default very much possible.,.,

    Hi <BR>YESS you can open a file in APPEND mode.<BR>And YESS you can add ASP code as well to it.<BR>See the sample code .<BR>You need to use ASC values for entering ASP identifiers "&#060;% %&#062;"<BR><BR>Rahul<BR>---------------------<BR>Set fso = CreateObject("Scripting.FileSystemObject")<BR>Set txtfile = fso.OpenTextFile("C:abc.txt", 8, True) &#039;Test file<BR>txtfile.Write chr(60) & chr(37) & " ASP code here " & chr(37) & chr(62)<BR> &#039;chr(60) for &#060; sign <BR> &#039;chr(62) for &#062; sign <BR> &#039;chr(37) for % sign <BR>txtfile.Close

Posting Permissions

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