Thanks for posting the bit of data. Base on the original output of what did/didn't get replaced, the sed is not replacing the tabs. The whitespace in the file is just tabs and spaces (nothing that might have been suppressed during printing etc.)
The problem lies with how the command is being interpreted, which seems odd since it works for me and apparently several other people.
Rather than sed, try this command:
Maybe it's the implementation of sed in your environment. If this doesn't work Im out of guesses.
it is much better now; I need to replace '/' by '_' also:
Hi guys, so I have another issue. Can I use sed to replace spaces in a string or variable with %20
I am having trouble with using curl on URL's containing spaces
Thanks! (12 Replies)
I am searching while I await a response to this so if it has been asked already I apologize.
I have a file with lines in it that look like:
bob johnson email@email.org
I need it to look like:
bob:johnson:email@email.org
I am trying to use sed like this:
sed -e 's/ /:/g' file >... (5 Replies)
Hello All,
I am trying to remove all tabspaces and all blankspaces from my file using sed & awk, but not getting proper code. Please help me out.
My file is like this (<b> means one blank space, <t> means one tab space)-
$ cat file
NARESH<b><b><b>KUMAR<t><t>PRADHAN... (3 Replies)
Hi,
i call my shell like:
my_shell "my project name"
my script:
#!/bin/bash -vx
projectname=$1
sed s/'PROJECT_NAME ='/'PROJECT_NAME = '$projectname/ <test_config_doxy >temp
cp temp test_config_doxy
the following error occurres:
sed s/'PROJECT_NAME ... (2 Replies)
Hi all,
Been trying to find a solution to this, I'm sure its a sed 1 liner, but I don't know sed well enough to work it out...
I have a text file in the following format:
431 666 1332 2665 0.24395
432 670 ... (3 Replies)
Dear Friends,
I have a flat file from which I want to remove single "space". And, wherever two spaces are provided it should replace it by only one space.
E.g.
I have
N A T I O N A L E D U C A T I O N F O R O R G AN I S A T I ON S
I want
NATIONAL EDUCATION FOR ORGANISATIONS
Please... (5 Replies)
Hi Guys
file:///C:/DOCUME%7E1/c104058/LOCALS%7E1/Temp/moz-screenshot.pngsed 's///g' /source/filename.txt > /destination/filename.txt
The above code deletes the characters which are not A-Z, a-z and 0-9, but I wanted to replace it with space without deleting them.
Any help is... (2 Replies)
cat rf|nawk '/Use SSL= 0/{n+=1}{if (n==3){sub("Use SSL= 0","Use SSL= 0x1",$0)};print }' > rf2Fails.
sed 's/Use SSL= 0/Use SSL= 0x1/g' rf > rf2Fails.
In addition, the goal is to ONLY replace the 2nd occurence of the... (15 Replies)
I'm using sh on hp-ux. I've got a file that looks like this.
-5.65 175
-16.17 160
-13.57 270
-51.72 260
-8.30 360
-42.71 460
-.38 375
-.20 375
-4.15 170
-21.53 560
-18.84 360
I'd like to replace all the whitespace between the columns with one comma. I can't... (4 Replies)
I am trying to replace the string in position 26 through 35 of the data file with 10 spaces and I want the remaining file to stay as is, the record length is over 900 characters? I am trying to use the AWK and substr but I am not getting it formatted correctly.
Before... (6 Replies)