Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all! We have been experiencing an issue on site where threads have been missing the latest postings. The platform host Vanilla are working on this issue. A workaround that has been used by some is to navigate back a page or two to re-sync the thread and this will then show latest posts. Thanks, Mike.

merge all text files in a given folder using windows scripting

  • 06-08-2005 5:10pm
    #1
    Registered Users, Registered Users 2 Posts: 68 ✭✭


    Please help

    I can combine the contents of 2 .txt files but I can't seem to make the evolutionary leap of merging all .txt files into a new .txt file.

    see this sample all suggestions appreciated

    Set txtFile1=FSO.OpenTextFile(File1,1)

    Set txtFile2=FSO.OpenTextFile(File2,8)
    Do while txtFile1.AtEndOfline <> True
    txtFile2.writeline(txtFile1.readline & vbcr)
    Loop
    txtFile1.close
    txtFile2.close


    alan :cool:


Comments

  • Registered Users, Registered Users 2 Posts: 288 ✭✭gordonnet


    you can use a batch file: eg merge.bat

    @echo off
    type *.txt >> report.log
    ren report.log report.txt


  • Registered Users, Registered Users 2 Posts: 68 ✭✭alancool


    I currently use a batch file to accomplish this merge but I've been asked to skool up on an alternative script host method.

    This will ultimately be a subroutine in a larger script... hopefully!

    Thanks again... this also works in the bat file given a naming convention.

    ECHO OFF
    copy ??-??-2005.txt+log.txt


    alan :cool:


Advertisement