tr: Deleting and squeezing characters


show more tr: Deleting and squeezing characters provides you with in-depth training on IT. Taught by Kevin Skoglund as part of the Unix for Mac OS X Users show less
please wait ...

tr: Deleting and squeezing characters

In the previous movie we saw how to use tr by looking at its standard translate usage. The tr has several options that we can specify that will allow us to work with it in other ways. Instead of translating, it can also allow you to delete or filter out characters into dedupe repeating characters, a process that it refers to as squeezing. The three options we are going to be looking out are the -d, -s and -c options. -d will delete characters in the set that we specify. So it'd just simply remove them. Instead of translating them that will just get removed. The -s option will squeeze repeats that are in the listed set.

So it won't necessarily squeeze everything, but the things that we've told it to, it will compress down. If we had for example five Xs in a row, it would turn it into one X instead, and then the -c option says Use the complementary set. It's the opposite. So you would use this option either with either the -d or the -s option. With the -d option I mean de...

tr: Deleting and squeezing characters
Video duration: 5m 30s 6h 35m Beginner

Viewers:

tr: Deleting and squeezing characters provides you with in-depth training on IT. Taught by Kevin Skoglund as part of the Unix for Mac OS X Users

Subject:
IT
Software:
Mac OS X Unix
Author:
please wait ...