How to print specific lines with specific colors?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
PaperTronics
Posts: 118
Joined: 02 Apr 2017 06:11

How to print specific lines with specific colors?

#1 Post by PaperTronics » 09 Sep 2017 02:26

Hey guys!

I want to print specific lines with specific colors but without using findstr /A.

Is there any other method to print lines with colors without using findstr?



Any help is greatly appreciated,
PaperTronics

Compo
Posts: 600
Joined: 21 Mar 2014 08:50

Re: How to print specific lines with specific colors?

#2 Post by Compo » 09 Sep 2017 05:08

Yes.

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

Re: How to print specific lines with specific colors?

#3 Post by Squashman » 09 Sep 2017 11:43

Windows 10 supports ANSI color.

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

Re: How to print specific lines with specific colors?

#4 Post by ShadowThief » 09 Sep 2017 14:04

PaperTronics wrote:but without using findstr /A.

Why?

PaperTronics
Posts: 118
Joined: 02 Apr 2017 06:11

Re: How to print specific lines with specific colors?

#5 Post by PaperTronics » 11 Sep 2017 06:49

@Compo - Could you please tell me that method

@Squashman - I want the method to be supported on all platforms

@ShadowThief - I forgot to describe why. Findstr does not support poison characters even after adding carrets. Is there a way to make findstr support poison characters? Also I'm CALLing the findstr command.



PaperTronics

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: How to print specific lines with specific colors?

#6 Post by aGerman » 11 Sep 2017 12:51

PaperTronics wrote:Findstr does not support poison characters even after adding carrets.

See e.g.
viewtopic.php?p=41155#p41155
viewtopic.php?t=3248&start=15

Steffen

PaperTronics
Posts: 118
Joined: 02 Apr 2017 06:11

Re: How to print specific lines with specific colors?

#7 Post by PaperTronics » 13 Sep 2017 04:06

@aGerman - Thanks! I'm now using carlos' utility to print out color.



PaperTronics

Post Reply