RE: Insert blank rows when merging files
- From: XP <XP@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 14 May 2008 11:49:03 -0700
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.
- References:
- Insert blank rows when merging files
- From: XP
- Insert blank rows when merging files
- Prev by Date: Re: Drag an image possible in an hta?
- Next by Date: Writing VBA Script
- Previous by thread: Insert blank rows when merging files
- Next by thread: Writing VBA Script
- Index(es):