perl -lne'chomp;@a=split/:/;push@{$h{$1}},[@a]if(/(.+){/../}/)&& length($a[1]);END{for(keys%h){$h{$_}=~s/$_.*{|\t//g;print"$_ {"; for(@{$h{$_}}){print" $_->[0] : $_->[1]";}print"}\n"}}' test.css
In reply to CSS parsing by bageler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |