Created
April 19, 2013 10:28
-
-
Save lafka/5419498 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# yes i can do this in sed, why you say? becouse i want to :) | |
# s/^[^a-z \t].*//;/^$/d # Remove non-parsed lines | |
# /\[/ { :r # Start loop looking for end ] | |
# /\]/!N; s/,?\n/,/; tr; # If ending ] is not found, append and repeat | |
# } | |
# s/\s+/ /g; # Normalize spaces | |
# p # Print the pattern space | |
sed -nE 's/^[^a-z \t].*//;/^$/d; /\[/ { :r; /\]/!N; s/,?\n/,/; tr; }; s/\s+/ /g; p' $conffile | |
# Will parse: | |
#dependencies <- | |
# lager =2.0.0 @github.basho @basho #2.0.0rc1 | |
# tavern @github.lafka | |
# riak-erlang-client @github.basho @github.lafka [ name = riakc | |
# version = "1.3.1.1" | |
# ref = "1.3.1.1" ] | |
# Into: | |
# dependencies <- | |
# lager =2.0.0 @github.basho @basho #2.0.0rc1 | |
# tavern @github.lafka | |
# riak-erlang-client @github.basho @github.lafka [ name = riakc, version = "1.3.1.1", ref = "1.3.1.1" ] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment