Lum – cut column 2 from text file

columnscuttext processing

My text file has no delimiter to specify separator just spaces, how do I cut out column 2 to output file,

39    207  City and County of San Francisc   REJECTED          MAT = 0
78    412  Cases and materials on corporat   REJECTED          MAT = 0
82    431  The preparation of contracts an   REJECTED          MAT = 0

So output I need is

207
412
432

Best Answer

It is easiest with awk which treats multiple consecutive spaces as a single one, so

awk '{print $2}' file

prints

207
412
431

But obviously there are many, many other tools which will do the job, even not designed to such task as grep:

grep -Po '^[^ ]+[ ]+\K[^ ]+' file
Related Question