Re: carriage return in Windows Scripting
- From: Gonzo58 <Gonzo58@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 20 Sep 2006 09:40:02 -0700
Thank you for your recommendation here.
The “copy /b” option probably won’t work because I’m using ifmember to
reactively add these reactively. Separate tests are performed and if the
user belongs to a particular Group, then txt files are appended.
I’m interested by what you mean “You could create file (0.txt) with on a
CrLf then do”. What exactly would I add to the “0.txt” file that would
invoke the carriage return? Actually, it would be great to add this to the
end of each of the existing txt files so that I wouldn’t have to create the
extra 0.txt file. Is this possible?
Thank you again.
"McKirahan" wrote:
"Gonzo58" <Gonzo58@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message.
news:2E714E23-8C74-4161-B13C-48E16EA8D49F@xxxxxxxxxxxxxxxx
What I actually need to identify what qualifies as a "carriage return" inusers
Windows Scripting. The script that I'm using creates a TMP file in a
TEMP folder. This TMP file populates with text using the TYPE command(TYPE
sourcefile.txt>>destinationfile.TMP).opposed
The trouble that I'm having relates to the fact that I'm using TYPE up to
three times. Essentially I append text in to the same temp file multiple
times. At the time the TYPE command is issued for the *second* time, the
"point of insertion" is at the very end of the last line of text...as
to having a carriage return and inserting in the next line below. For
example:
Data from 1st append
Data from 1st append
Data from 1st appendData from 2nd append
Data from 2nd append
Data from 2nd append
...
Somehow, I need to have a "carriage return" to bump the start of the "Data
from 2nd append" down to the next line.
Is this possible?
In VBscript you would use vbCrLf.
However, you're using the command-line command "type".
I gather that you've got something like this:
type 1.txt > 123.txt
type 2.txt >> 123.txt
type 3.txt >> 123.txt
You could also try copy /b 1.txt+2.txt+3.txt 123.txt
The both may give the same result.
You could create file (0.txt) with on a CrLf then do
type 1.txt > 123.txt
type 0.txt >> 123.txt
type 3.txt >> 123.txt
type 0.txt >> 123.txt
type 3.txt >> 123.txt
or
copy /b 1.txt+0.txt+2.txt+0.txt+3.txt 123.txt
Otherwise use the FileSystemObject within a VBS file.
- Follow-Ups:
- Re: carriage return in Windows Scripting
- From: McKirahan
- Re: carriage return in Windows Scripting
- References:
- Re: carriage return in Windows Scripting
- From: McKirahan
- Re: carriage return in Windows Scripting
- Prev by Date: Re: carriage return in Windows Scripting
- Next by Date: Re: carriage return in Windows Scripting
- Previous by thread: Re: carriage return in Windows Scripting
- Next by thread: Re: carriage return in Windows Scripting
- Index(es):
Relevant Pages
|