Let us turn our thoughts from looping and look upon another type of tool, one which lets us extract certain parts of Lines from Files, while ignoring other parts which do not meet our fancy. This fine tool is called ‘cut’, named for the cutlery with which we may similarly slice our breakfast mutton or supper eel.
There are two principal ways to use ‘cut’ to carve out the tasty morsels from our Files. The first Option, and simpler, is ‘-c’, ‘dash see’. With this option you may specify the character-columns to cut from each line that passeth under the sharp blades of ‘cut’. Numbers given with this Option may be listed singly, with commas, or as a range. Note that column counting begins at One, not Zero. Id est:
Cutting out columns from thy File is an estimable ability, and fruitful. Yet not all Files have their Contente arrayed so straight and true, like the white trunks of the birch-forest. This is why ‘cut’ hath been endowed with another Option, ‘-f’, dash eff. Use this to tell ‘cut’ that not the column, but rather, the Field ye seek. These Fields are presumed divided by Tabbes, unless ‘cut’ be instructed to use a different de-limiter, and thus a third Option arises, ‘-d’, dash dee. Id est:
There is one more trick which you may needs avail yourself of, with either the ‘-c’ or the ‘-f’ Options. If thy wish is to circumscribe a particular character-column or a particular field, and from thence also to the end of each line, then simply abandon the final number of the range and it will be so.