Skip to main content
added 28 characters in body
Source Link
hek2mgl
  • 156.1k
  • 28
  • 254
  • 273

I would use awk for the colorization (sed can be used as well):

awk '{printf "\033[1;32m%s\t\033[00m\033[1;33m%s\t\033[00m\033[1;34m%s\033[00m\n", $1, $2, $3;}' a.txt 

and pipe it to column for the alignment:

... | column -s$'\t' -t

Output:

output

I would use awk for the colorization:

awk '{printf "\033[1;32m%s\t\033[00m\033[1;33m%s\t\033[00m\033[1;34m%s\033[00m\n", $1, $2, $3;}' a.txt 

and pipe it to column for the alignment:

... | column -s$'\t' -t

Output:

output

I would use awk for the colorization (sed can be used as well):

awk '{printf "\033[1;32m%s\t\033[00m\033[1;33m%s\t\033[00m\033[1;34m%s\033[00m\n", $1, $2, $3;}' a.txt 

and pipe it to column for the alignment:

... | column -s$'\t' -t

Output:

output

added 74 characters in body
Source Link
hek2mgl
  • 156.1k
  • 28
  • 254
  • 273

I would use awk for the colorization:

awk '{printf "\033[1;32m%s\t\033[00m\033[1;33m%s\t\033[00m\033[1;34m%s\033[00m\n", $1, $2, $3;}' a.txt 

and pipe it to column for the alignment:

... | column -s$'\t' -t

Output:

output

I would use awk for the colorization:

awk '{printf "\033[1;32m%s\t\033[00m\033[1;33m%s\t\033[00m\033[1;34m%s\033[00m\n", $1, $2, $3;}' a.txt 

and pipe it to column for the alignment:

column -s$'\t' -t

I would use awk for the colorization:

awk '{printf "\033[1;32m%s\t\033[00m\033[1;33m%s\t\033[00m\033[1;34m%s\033[00m\n", $1, $2, $3;}' a.txt 

and pipe it to column for the alignment:

... | column -s$'\t' -t

Output:

output

Source Link
hek2mgl
  • 156.1k
  • 28
  • 254
  • 273

I would use awk for the colorization:

awk '{printf "\033[1;32m%s\t\033[00m\033[1;33m%s\t\033[00m\033[1;34m%s\033[00m\n", $1, $2, $3;}' a.txt 

and pipe it to column for the alignment:

column -s$'\t' -t