0
votes
1answer
20 views

Replace '-' char using sed

I have a text file, quite similar to this one: JACK BLACK 123456 -1245368 - BRIDGET RED 1245 548425 + JOHNNY HOMUSS 55482 -4325 - I wanted to use a sed command ...
0
votes
3answers
57 views

How do I exclude match and change only specific character with sed

I am trying to use sed to replace '0' with the word 'correct' (I am using echo $? to validate my script and I want to replace the output of echo). The problem is that I have more text in the output ...
1
vote
1answer
298 views

Batch search and replace file path

So I've got lots of m3u playlists created on my Windows machine inside a folder with file paths to tracks as: D:\path-of-mp3 So first I want to replace all the \ with / and then D: with ...
1
vote
2answers
220 views

replace all names with an alternative using Stream editor (Sed)

I got this question on a task. Nothing works.. Can someone help me? Write a sed script that replace all names with an alternative, search for every words that: Start with a capital, Longer than ...
1
vote
2answers
176 views

Replaces images\(.*)“ with images/\1” in all files?

I've got a bunch of html files, and all the img tags have the slashes the wrong way! Here's an example (except it's one line in the code, split here for ease of viewing) <a ...
2
votes
1answer
889 views

how to remove html comment tags using sed?

I want to remove comment tags in an html file. <!--- <script save and execute me> --> must become: <script save and execute me> I tried sed -i s_^<!-- \(.*\) -->$_\1_ ...
2
votes
2answers
264 views

sed in bash not working

I am trying to use the stream editor sed in bash to replace a string in a file to a new string that I entered, I have this thus far: echo "name to change" read updatenaamold echo "enter new name:" ...
5
votes
3answers
1k views

Am I using sed properly to perform this conditional replace? Is there a better way?

I have a space-delimited file that's about 3200 lines long. Each line contains 7+ fields. What I would like to do is edit the file with sed so that every line containing a certain variable in field 5 ...
1
vote
4answers
2k views

using sed to replace two patterns within a larger pattern

Using sed how could I replace two patterns within a larger pattern on a single line? Given a single line of text I want to find a pattern (Let's call this the outer pattern) and then within that ...