type not breaks on 1a

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
carlos
Expert
Posts: 503
Joined: 20 Aug 2010 13:57
Location: Chile
Contact:

type not breaks on 1a

#1 Post by carlos » 31 Jan 2014 16:16

Hello. Until now I says that type command break on 1a character. But now, with more test I found that the type command end printing to screen on 1a character, but if redirect to the file, the file have all the data.

Example:
file.txt with:
text1[1A]text2


type file.txt
will print only text1

but type file.txt > mirror.log
mirror.log will have the same data that file.txt

I'm curious about why the data stop on the screen but not on the redirection file

Sponge Belly
Posts: 234
Joined: 01 Oct 2012 13:32
Location: Ireland
Contact:

Re: type not breaks on 1a

#2 Post by Sponge Belly » 01 Feb 2014 05:04

Hi Carlos,

Reread the recent Ctrl-Z Blues topic. You contributed towards the end, but I recommend reading the whole thing from the beginning. You’ll find out more about Ctrl-Z than you ever wanted to know! ;-)

- SB

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: type not breaks on 1a

#3 Post by penpen » 01 Feb 2014 12:30

The type command breaks the line containing only 0x1A character:
test.dat wrote:68 69 1A 74 68 65 72 65
Then just call:

Code: Select all

Z:\>cmd /U
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

Z:\>type test.dat > test2.dat
test2.dat wrote:68 00 69 00
You can see that it is not caused by the output stream with this batch:

Code: Select all

@echo off
(
   cmd /d /u /c type "test.dat"
   echo abc
) > "test3.dat"
test3.dat wrote:68 00 69 00 61 62 63 0D 0A

penpen

Edit: added the "seem to" and the note.
Edit2: removed the "seem to" and replaced the note by the batch.

Note: I've remeoved my WRONG last post: lacking in concentration. Sorry to all.

Post Reply