Interview Question

Interview Austin, TX

How do you change a list of words in a file from slug

  format to Capitalized words? (ie police_officer to Police Officer)
Answer

Interview Answer

2 Answers

0

sed -e 's/^./\U&/' -e 's/_./\U&/g' -e 's/_/ /g' /path/to/input

Interview Candidate on Feb 6, 2013
0

|sed 's/\(^.\)\([a-z].*\)\(\_\)\(.\)\([a-z].*\)/\U\1\L\2 \U\4\L\5/'

Gregg Leventhal on Apr 29, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.