Some content of text file lost when printing to screen

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Some content of text file lost when printing to screen

#16 Post by aGerman » 22 Apr 2019 05:57

The internal buffer used for SET /P is 1024 characters wide. One element is for the terminating null in C. Since a line on Windows ends with Carriage Return and Line Feed characters, lines that exceed a length of 1021 characters will result in an unreliable and probably faulty content of the line read. That was the reason for my question.
Elsewise, SET /P is commonly used to read the first line of a file. Called in a loop and applied to the same input stream, it is able to read linewise.

Steffen.

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: Some content of text file lost when printing to screen

#17 Post by Squashman » 22 Apr 2019 08:43

sincos2007 wrote:
22 Apr 2019 05:24
I have seen following syntax in bash shell
doubtful.

ShadowThief
Expert
Posts: 1160
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: Some content of text file lost when printing to screen

#18 Post by ShadowThief » 22 Apr 2019 12:51

Squashman wrote:
22 Apr 2019 08:43
sincos2007 wrote:
22 Apr 2019 05:24
I have seen following syntax in bash shell
doubtful.
Maybe they mean the

Code: Select all

<in_file >outfile
bit? I know I don't use that too often outside of Linux.

Post Reply