Sponsored Content
Top Forums Shell Programming and Scripting sed replacement, challenge one!!!! Post 302182702 by V3l0 on Monday 7th of April 2008 11:14:31 AM
Old 04-07-2008
NICE !!! SmilieSmilie

Quote:
Originally Posted by chella
Hi,

How about the below one,

Code:
sed 's/TT/#T#T/g;s/BB/#B#B/g;/#/!s/TB.*TB/T/g;/#/!s/TB/T/g;s/#//g' inp.txt

does it help?

Regards,
Chella
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Replacement using sed

Hi I have the following file that i need to run a sed command on 1<tab>running 2<tab>running 3<tab>running 4<tab>running I want to be able to replace a line i.e the second one with '2<tab>failed'. As the first number is unique that can be used to search for the relevant line (using ^2 i... (5 Replies)
Discussion started by: handak9
5 Replies

2. UNIX for Dummies Questions & Answers

A challenge for you sed/awk wizards...

Here's a challenge for you wizards... I have a file formatted as follows; $ What I need to output is; 87654321 Bobby One 12345678 Bobby One 09876543 Bobby One 1107338 Bobby! Two Any Ideas how I can do this? I've tried sed but I'm not sure if perl might be a better way to... (2 Replies)
Discussion started by: th3g0bl1n
2 Replies

3. Shell Programming and Scripting

Need Replacement for sed

Hi Can anyone provide me the replacement of sed with xargs perl syntax for the below sed -e :a -e '/;$/!N;s/\n//; ta' -e 's/;$//' This should be without looping has to take minimal time for search (0 Replies)
Discussion started by: dbsurf
0 Replies

4. Shell Programming and Scripting

sed xml challenge

I have a web xml file that looks like this: <allinfo> <info> <a>Name1<\a> <b>address1<\b> <c>phone1<c> <\info> <info> <a>Name2<\a> <b>address2<\b> <c>phone2<c> <\info> <\allinfo> I want to use sed to... (2 Replies)
Discussion started by: katrvu
2 Replies

5. Shell Programming and Scripting

Help with sed replacement

This seems like it should be an easy problem, but I'm a noob and I can't figure it out. I'm trying to use sed, but would be happy to use anything that does the job. I am trying to trim off a fixed number of unknown characters from 2 different : delimited fields while keeping the intervening... (4 Replies)
Discussion started by: helix_w
4 Replies

6. Shell Programming and Scripting

Replacement with sed

I am trying to replace the line which has string "tablespace" not case senstive.... with below simple script: mysrcipt.sh sed "s/.*/TABLESPACE USERS/g" create_table > tmp mv tmp create_table Is there any better way to do it? If Search string tooooooo long it will be tough to code in... (4 Replies)
Discussion started by: ganeshd
4 Replies

7. Shell Programming and Scripting

SED replacement

Hi, i have a file with lines, file.txt ------- test is fun testing is better I need to replace 'test' to 'develop' and i used, a=test b=develop sed "s,$a,$b,g" -------- but i see the word 'testing' is also replaced. Need some solution. Is there any way i could replace only 'test' ? (4 Replies)
Discussion started by: giri_luck
4 Replies

8. Shell Programming and Scripting

SED replacement of placeholders

Hi All, I am facing a problem while using SED in Linux. I have a property file which contains a string local.mds.dir=${basedir}/deployCompositesIt has be to replaced with another string, and value of that string should be initialized at runtime. So I use placeholder there. My substituted... (2 Replies)
Discussion started by: bhaskar_m
2 Replies

9. UNIX for Advanced & Expert Users

Interesting awk/Perl/sed parsing challenge

I have a log with entries like: out/target/product/imx53_smd/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/bindings/V8HTMLVideoElement.cpp : target thumb C++: libwebcore <=... (8 Replies)
Discussion started by: glev2005
8 Replies

10. UNIX for Dummies Questions & Answers

sed replacement inplace

I need to make permanent changes in the file after find and replace using sed. for this i am using sed -i However this is not working. says sed: illegal option -- i I am working on Sun Solaris uname -a SunOS aspsun14 5.10 Generic_150400-13 sun4u sparc SUNW,SPARC-Enterprise any other work... (3 Replies)
Discussion started by: gotamp
3 Replies
PSPELL_CONFIG_SAVE_REPL(3)						 1						PSPELL_CONFIG_SAVE_REPL(3)

pspell_config_save_repl - Determine whether to save a replacement pairs list along with the wordlist

SYNOPSIS
bool pspell_config_save_repl (int $dictionary_link, bool $flag) DESCRIPTION
pspell_config_save_repl(3) determines whether pspell_save_wordlist(3) will save the replacement pairs along with the wordlist. Usually there is no need to use this function because if pspell_config_repl(3) is used, the replacement pairs will be saved by pspell_save_wordlist(3) anyway, and if it is not, the replacement pairs will not be saved. pspell_config_save_repl(3) should be used on a config before calling pspell_new_config(3). PARAMETERS
o $dictionary_link - o $flag - TRUE if replacement pairs should be saved, FALSE otherwise. RETURN VALUES
Returns TRUE on success or FALSE on failure. NOTES
Note This function will not work unless you have pspell .11.2 and aspell .32.5 or later. PHP Documentation Group PSPELL_CONFIG_SAVE_REPL(3)
All times are GMT -4. The time now is 07:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy