Last active
March 10, 2017 12:30
-
-
Save MattMS/006ed0951e69ce281f4c2df4b2631cfa to your computer and use it in GitHub Desktop.
Print the second column (space-delimited) of a file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Given my_file containing first line of "my_id my_value", this will print "my_value". | |
cat ./my_file | sed -En '1{s/^(\S+)\s+(.*)$/\2/g ; p}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment