In my text file there are many lines whose contents are almost the same. Here are some of them.
So, what I want is to overwrite the /
with -
on every line and then insert -
in front of the line exactly above the line that has the /
character overwritten.
Right now I'm trying:
cat text | sed "/\//s/^/- /g;s/\/ /\n- /g"
Input file:
1
00:00:00,000 --> 00:00:00,000
You are older.
2
00:00:00,000 --> 00:00:00,000
By length of a sunset.
/ Is older.
3
00:00:00,000 --> 00:00:00,000
Soona.
4
00:00:00,000 --> 00:00:00,000
Noa!
/ Noa, wait!
Expected output:
1
00:00:00,000 --> 00:00:00,000
You are older.
2
00:00:00,000 --> 00:00:00,000
- By length of a sunset.
- Is older.
3
00:00:00,000 --> 00:00:00,000
Soona.
4
00:00:00,000 --> 00:00:00,000
- Noa!
- Noa, wait!