我遇到的情況,該文件具有以下結構:在標題後打印文件中的第二個字段。
This is the list of all the employees and their desk numbers
Please dont exchange the chairs or drawers
Handle the furniture around with care
Name Desk No
---- -------
Joe 445
May 560
Sue 669
我只需要拿到桌子號碼。我想使用作爲過濾器,並在後面的文本之後打印第二列。有更好的解決方案
有趣。你能解釋一下這些步驟嗎? '$ 1 ==「----」'得到這條線,然後你如何從那裏打印? – fedorqui 2013-03-07 12:41:03
我已經添加了解釋@fedorqui希望這是有幫助的。 – 2013-03-07 12:45:04
+1,我覺得它非常聰明。我總是從你的答案中學習。 – fedorqui 2013-03-07 12:49:22