I need a VBS script to output the first line of text along with another line of text for file data.txt.
example of my开发者_如何学C text.txt file
line1 + line2 to 1.txt line1 + line3 to 2.txt line1 + line4 to 3.txt
Thanks in advance, Best regards, joe
Long time since i used VBS
Set fso = CreateObject("Scripting.FileSystemObject")
set src = fso.OpenTextFile("test.txt",1)
lines = split(src.readall,vbcrlf)
for i = 1 to ubound(lines)
 set dst = fso.CreateTextFile( i & ".txt", true)
 dst.writeline lines(0)
 dst.writeline lines(i)
 dst.close
next
You can write to files using the FileSystemObject. This page shows some sample code for opening and writing to a file: Working with Files
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论