The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sed - replace $ tjmannonline UNIX for Dummies Questions & Answers 2 10-09-2009 07:38 AM
awk - replace number of string length from search and replace for a serialized array otrotipo Shell Programming and Scripting 1 07-10-2009 01:04 PM
Replace in VI preethgideon UNIX for Dummies Questions & Answers 3 11-27-2008 01:42 AM
replace charandevu Shell Programming and Scripting 6 04-07-2008 12:30 PM
replace last / by | naikaa Shell Programming and Scripting 6 01-17-2008 02:19 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 4 Weeks Ago
DerangedNick DerangedNick is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 17
Using SED to Replace \|

I have been trying for a couple of hours now to use sed to replace a string in a file. The file is delimited by pipes (|) and I have tried writting the script several different ways.
The problem is that when there is a slash prior to a delimiter that it is being kicked out by my DB. So I am trying to remove them all.

sed -e 's:\|:|:g' input > output
sed -e 's/\|/|/g' input > output

I've also tried sed -e 's/\\|/|/g' input > output and many other variations of this. However so far I have not had any luck.

It will run, however it will not remove the text and replace it with just a pipe.

If anyone has any suggestions it'd be appreciated.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:01 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0