remove a word from many places in a long text file
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
Suppose I have a file with many lines of the form
date time name some stuff
where every line may be different except for 'name', which is the same every time, and I want to remove 'name' from every line: is it possible to write a short bash script to achieve this?
bash awk sed grep
add a comment |Â
up vote
0
down vote
favorite
Suppose I have a file with many lines of the form
date time name some stuff
where every line may be different except for 'name', which is the same every time, and I want to remove 'name' from every line: is it possible to write a short bash script to achieve this?
bash awk sed grep
Where does "recursive" come into play here?
â Kusalananda
Mar 5 at 15:11
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Suppose I have a file with many lines of the form
date time name some stuff
where every line may be different except for 'name', which is the same every time, and I want to remove 'name' from every line: is it possible to write a short bash script to achieve this?
bash awk sed grep
Suppose I have a file with many lines of the form
date time name some stuff
where every line may be different except for 'name', which is the same every time, and I want to remove 'name' from every line: is it possible to write a short bash script to achieve this?
bash awk sed grep
edited Mar 5 at 15:36
Archemar
18.9k93366
18.9k93366
asked Mar 5 at 15:02
jj_p
1836
1836
Where does "recursive" come into play here?
â Kusalananda
Mar 5 at 15:11
add a comment |Â
Where does "recursive" come into play here?
â Kusalananda
Mar 5 at 15:11
Where does "recursive" come into play here?
â Kusalananda
Mar 5 at 15:11
Where does "recursive" come into play here?
â Kusalananda
Mar 5 at 15:11
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
Gilles answer works but it will only remove name
from standard output. If you want to remove name
from the file itself then you need:
sed -i 's/name//' file
add a comment |Â
up vote
4
down vote
Why not simply :
sed 's/name//' file
?
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Gilles answer works but it will only remove name
from standard output. If you want to remove name
from the file itself then you need:
sed -i 's/name//' file
add a comment |Â
up vote
1
down vote
accepted
Gilles answer works but it will only remove name
from standard output. If you want to remove name
from the file itself then you need:
sed -i 's/name//' file
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Gilles answer works but it will only remove name
from standard output. If you want to remove name
from the file itself then you need:
sed -i 's/name//' file
Gilles answer works but it will only remove name
from standard output. If you want to remove name
from the file itself then you need:
sed -i 's/name//' file
answered Mar 5 at 15:59
Nasir Riley
1,514138
1,514138
add a comment |Â
add a comment |Â
up vote
4
down vote
Why not simply :
sed 's/name//' file
?
add a comment |Â
up vote
4
down vote
Why not simply :
sed 's/name//' file
?
add a comment |Â
up vote
4
down vote
up vote
4
down vote
Why not simply :
sed 's/name//' file
?
Why not simply :
sed 's/name//' file
?
answered Mar 5 at 15:05
Gilles Quenot
15.3k13448
15.3k13448
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f428292%2fremove-a-word-from-many-places-in-a-long-text-file%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Where does "recursive" come into play here?
â Kusalananda
Mar 5 at 15:11