
![]() |
tomt
I have the following vbscript that works if I place the script inside the directory folder of text files and run it from there. It merges all text files into one text file.
Set fso = CreateObject("Scripting.FileSystemObject" ![]() set mainfolder=fso.GetFolder("." ![]() Set filecollection = mainfolder.Files Set objfileOut=fso.OpenTextFile ("merged.txt",2,true) init=false For Each fileList In filecollection If fso.GetExtensionName(fileList.Path)="txt" Then Set objfileRead=fileList.OpenAsTextStream(1) objfileOut.Write VBCRLF & "<file>" & VBCRLF objfileOut.Write "<filename>" & fileList.name & "</filename>" & VBCRLF objfileOut.Write VBCRLF & "<article>" & VBCRLF objfileOut.Write objfileRead.ReadAll objfileOut.Write VBCRLF & "</article>" & VBCRLF objfileOut.Write VBCRLF & "</file>" & VBCRLF objfileRead.Close End If Next I am trying to make a windows form in vb .netto do the same thing. I am using FolderBrowserDialog to get the directory folder. I can't get the vbscript converted correctly. Any help would be appreciated.Thanks, Tom tomt
Update.
Between my son, who knows vb .net100 times better than me, and Google, I got the code rewrote and it works.Tom perkiset
Right on... and what a cool and humorous place to resource.
Please invite your son to join us here ... ![]() /p tomt
Shawn is more into game
programming.Tom |

Thread Categories

![]() |
![]() |
Best of The Cache Home |
![]() |
![]() |
Search The Cache |
- Ajax
- Apache & mod_rewrite
- BlackHat SEO & Web Stuff
- C/++/#, Pascal etc.
- Database Stuff
- General & Non-Technical Discussion
- General programming, learning to code
- Javascript Discussions & Code
- Linux Related
- Mac, iPhone & OS-X Stuff
- Miscellaneous
- MS Windows Related
- PERL & Python Related
- PHP: Questions & Discussion
- PHP: Techniques, Classes & Examples
- Regular Expressions
- Uncategorized Threads