Interview Question: How do you change a list of w... | Glassdoor

Interview Question

Linux Systems Administrator I 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)
technical, behavioral, linux, networking, interactive, wordpress, sed, grep  See More

Interview Answer

2 Answers


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

Interview Candidate on Feb 6, 2013

|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.