If Perl is an option:
perl -lane 'splice @F,0,2; print join " ",@F' file
These command-line options are used:
-n
loop around every line of the input file, do not automatically print it
-l
removes newlines before processing, and adds them back in afterwards
-a
autosplit mode – split input lines into the @F
array. Defaults to splitting on whitespace
-e
execute the perl code
splice @F,0,2
cleanly removes columns 0 and 1 from the @F
array
join " ",@F
joins the elements of the @F
array, using a space in-between each element
Variation for csv input files:
perl -F, -lane 'splice @F,0,2; print join " ",@F' file
This uses the -F
field separator option with a comma