HackerRank - Sed Command #1
April - 25/2025Problem:
For each line in a given input file, transform the first occurrence of the word 'the' with 'this'. The search and transformation should be strictly case sensitive.
# Input
- From fairest creatures we desire increase,
- .
- .
- .
- Shall sum my count, and make my old excuse'
# Output
- From fairest creatures we desire increase,
- .
- .
- .
- Shall sum my count, and make my old excuse'
# Solution
sed -e '{s/ the / this /}'