10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have text file which is a tab delimited one. Sample data from the file is shown below:
unix is\ great\ os
linux\ is superb
I want to replace that backslash with empty string preserving the tab delimiter. Output should be
unix is great os
linux is ... (3 Replies)
Discussion started by: p.akhilreddy4u
3 Replies
2. Shell Programming and Scripting
Hi all,
My unix admin copied my code from old server to new server. I don't know exactly how he copied by at the end of each line i see ^M appeneded. The code has more than 200 lines could you please help me how to remove it easilt instead of deleting it manually......
Thanks,
Firestar. (6 Replies)
Discussion started by: firestar
6 Replies
3. Shell Programming and Scripting
I have a log output with a format similar to this:
a=1, b= 2
c=0, d= 45, e=100
... and so on.
I figure I can just use awk or something to pipe the file to sed, but I'm trying to replace all the values above with 0.
I've tried:
cat blah | sed 's/=\(.*\),/0/'but that didn't work. ... (6 Replies)
Discussion started by: throw_a_stick
6 Replies
4. Shell Programming and Scripting
for eg:
i have i/p file as:
================
i
wnt
to
change end of line
=================
my require ouput is like:
i wnt to change end of line
==================== (7 Replies)
Discussion started by: RahulJoshi
7 Replies
5. Shell Programming and Scripting
Hi !
I'm rather new with sed ... learned a lot already by googling etc ...
The following script should replace all spaces and ends-of-lines with "something (see below).
#!/bin/bash
i=0
while read line
do
fam="H`printf "%06d" $i`"
echo $line | sed -e 's//\t'$fam'\n/g'
i=$(($i+1))... (7 Replies)
Discussion started by: jossojjos
7 Replies
6. Shell Programming and Scripting
Hi guys,
got a problem here with sed on the command line.
If i have a string as below:
online xx:wer:xcv: sdf:/asdf/http:https-asdfd
How can i match the pattern "http:" and replace the start of the string to the pattern with null?
I tried the following but it doesn't work:
... (3 Replies)
Discussion started by: DrivesMeCrazy
3 Replies
7. Shell Programming and Scripting
How do I remove parentheses using sed?
input (192.168.1.1)
output 192.168.1.1 (4 Replies)
Discussion started by: streetfighter2
4 Replies
8. Shell Programming and Scripting
hi
is it possible to cut this two semicolon separated sed commands
echo "string2 string3 string1" | sed s'/string1//g;s/string2//g'
output: " string3 "
to just one sed command without semicolon?
thanks in advance
funksen (10 Replies)
Discussion started by: funksen
10 Replies
9. Shell Programming and Scripting
Hello
My file looks like that =>
12.56 have then 7888778.2566 what 44454.54545
878787.66565 if else 4445.54545455
I want to change all '.' on ',' .
I'm trying to do it with sed but I don't know chow to build regular expression to
change 454.4466 on 454,4466 ? (13 Replies)
Discussion started by: scotty_123
13 Replies
10. UNIX for Dummies Questions & Answers
Is there an easier way to do the following:
echo "|||||||" | sed 's/||/|0|/g; s/||/|0|/g'
which would give the following
|0|0|0|0|0|0|
If it is not run twice it will not pick up the second occurance of the || and leave it empty as in
echo "|||||||" | sed 's/||/|0|/g'
which would give... (3 Replies)
Discussion started by: maverick
3 Replies