Jan
12th
Wed
12th
sed
It’s rather interesting that if I wanted to extract the first number from the following line:
2609 13541 186371 file.csv
Which generated by the command wc and has a variable number of whitespace before the first figure
If I were using a combination of wc, sed and cut, I have to use the following:
wc file.csv | sed -e ‘s/[ ][ ]*/:/g’ | cut -d “:” -f 2
instead of just
wc file.csv | sed -e ‘s/\s+/:/g’ | cut -d “:” -f 2