Re: carriage return in Windows Scripting

Tech-Archive recommends: Fix windows errors by optimizing your registry



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" in
Windows Scripting. The script that I'm using creates a TMP file in a
users
TEMP folder. This TMP file populates with text using the TYPE command
(TYPE
sourcefile.txt>>destinationfile.TMP).

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
opposed
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.



.



Relevant Pages

  • Re: Appending CR to syslog output?
    ... > How do I get syslog to append a CR to output when it's being sent to ... o Tell your printer that eols are LF instead of CRLF (if it can be ... o If your printer knows an escape sequence to put it in LF mode, ...
    (freebsd-questions)
  • Re: creating Access table from directory with files
    ... Open a Windows command prompt. ... unique index that includes the three fields. ... Create an Append query that appends data from the linked table to ... The first time you run the query, it will import all the records from ...
    (microsoft.public.access.externaldata)
  • Re: [Info-ingres] Need help Appending an extra footer line after using COPY .. INTO output_file,
    ... command, as that's the only thing after the 'cat' command line. ... David G. Brooks ... (shell scripting, declarations, etc.) ... Have both queries write to seperate files then append them at the OS ...
    (comp.databases.ingres)
  • Re: [patch 1/5] Extended crashkernel command line
    ... is that if you have a bootloader like lilo or elilo which allows you to append ... a command line parameter but not to remove one, ... AFAIK it is the other way round: the lilo configuration-parameter ... parameters given by the user on the kernel command line. ...
    (Linux-Kernel)
  • Re: Two users appending to the same table
    ... The INSERT-SQL command is fast, the old INSERT is the slowest way to go. ... Write a quickie app so that each user can create a local table containing the new records, then batch append them once or twice per day. ... thistable and its index are on a server ... But if one operator is removed, then the data entry goes faster.It actually goes faster with one operator than with two. ...
    (microsoft.public.fox.programmer.exchange)