Shell Data Processing - cut command

1 - About

cut is a filter command that remove text sections from each line

3 - Example

3.1 - Suppress only the first part of a line

Take the rest of the line after the first :


cut --delimiter ':' --fields=2-

where:

  • –delimiter specify the delimiter
  • –fields defined the field to chose (ie the columns) and its value 2- means all value from 2

3.2 - Suppress the first character


echo foo | cut --characters=2-
# short form
echo foo | cut -c2-

  • Result

oo

where:

  • --characters means that we are manipulating characters
  • 2- means character 2 to the end

Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap