sed: how to do simple transformations
Jump to:
Project: | Programming |
Component: | Documentation |
Category: | feature request |
Priority: | normal |
Assigned: | Unassigned |
Status: | closed |
Related pages: | #5370: sed |
Description
How to do simple transformations with sed?
In a text file, I want to transform "l'll" to "I'll".
Comments
#1
Start with:
sed 's/from/to/' file.txt
--in-place
#2
add a "g" at the end to make the changes global (i.e. not only change the first occurrence.
sed -i 's/from/to/g' file.txt
#3
The official documentation for GNU sed is not beginner friendly!
#4
updated wiki.
#5
Automatically closed -- issue fixed for 2 weeks with no activity.