Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ cat 1.txt
- '&1'
- '&2'
- '&3'
- :1
- :2
- :3
- awk '{gsub(/'"^'"'|'"'$"'/,"");gsub(/&/,":")}1' input
- :1
- :2
- :3
- sed -e 's/.*[^0-9]([0-9]+)[^0-9]*$/:1/' 1.txt
- :1
- :2
- :3
- $ cat 1.txt
- Monday {'&1', 'Morning', 'Breakfast'}
- Tuesday {'&2', 'Noon', 'Lunch'}
- Wednesday {'&3', 'Evening', 'Supper'}
- Thursday {'&4', 'Night', 'Dinner'}
- $ sed -E 's/x27&([0-9]+)x27/:1/' 1.txt
- Monday {:1, 'Morning', 'Breakfast'}
- Tuesday {:2, 'Noon', 'Lunch'}
- Wednesday {:3, 'Evening', 'Supper'}
- Thursday {:4, 'Night', 'Dinner'}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement