Remove leftmost column(s) from text file

less than 1 minute read

Related: remove right columns from text file


Remove the left N columns from a text file with the following:

Trim left columns

This example trims off the first 2 columns of each row of a text file “old.txt”, resaving as “new.txt”:

cut -c2- > new.txt < old.txt

For example:

  • clean diff output of all the plus/minus signs
  • eliminates garbage in the first column(s) of a text file

Tags:

Categories:

Updated:

Leave a comment