Hi, I have an HTA that is used to merge several hundred text files and in the snippet below, I show how I write the file name at the beginning of each merged chunk of data. This all works very well, but I would like to have the code actually insert two blank rows before and after each next file name; Can someone please correct my code below so that this will happen: For Each oFile in oFolder.Files If UCase(oFSO.GetExtensionName(oFile)) = "SQL" Then mlFileCountEND = mlFileCountEND + 1 sFileNameSRC = [INSERT ROWS] & "--" & oFile.Name & [INSERT ROWS] oMergeFile.WriteLine sFileNameSRC Set oSourceSTREAM = oFile.OpenAsTextStream(ForReading, TriStateUseDefault) Do sLine = oSourceSTREAM.ReadLine oMergeFile.WriteLine sLine Loop Until oSourceSTREAM.AtEndOfStream oSourceSTREAM.Close End IF Next oMergeFile.Close Thanks much in advance.
Issue resolved. In case anyone is interested: I was trying to use stuff like: Chr(13) However, I cracked it by just inserting blank lines like so (duh): oMergeFile.WriteLine "" oMergeFile.WriteLine "" oMergeFile.WriteLine sFileNameSRC oMergeFile.WriteLine "" oMergeFile.WriteLine "" Issue resolved. "XP" wrote: > Hi, > > I have an HTA that is used to merge several hundred text files and in the > snippet below, I show how I write the file name at the beginning of each > merged chunk of data. This all works very well, but I would like to have the > code actually insert two blank rows before and after each next file name; Can > someone please correct my code below so that this will happen: > > For Each oFile in oFolder.Files > If UCase(oFSO.GetExtensionName(oFile)) = "SQL" Then > mlFileCountEND = mlFileCountEND + 1 > sFileNameSRC = [INSERT ROWS] & "--" & oFile.Name & [INSERT ROWS] > oMergeFile.WriteLine sFileNameSRC > Set oSourceSTREAM = oFile.OpenAsTextStream(ForReading, > TriStateUseDefault) > Do > sLine = oSourceSTREAM.ReadLine > oMergeFile.WriteLine sLine > Loop Until oSourceSTREAM.AtEndOfStream > oSourceSTREAM.Close > End IF > Next > oMergeFile.Close > > Thanks much in advance.