Sponsored Content
Full Discussion: multiple delete using sed
Top Forums Shell Programming and Scripting multiple delete using sed Post 78653 by vgersh99 on Thursday 21st of July 2005 08:40:35 AM
Old 07-21-2005
vino,
you have mis-balanced single-quotes in your 'sed'. Plus single-quotes will prevent shell variables from being expanded.

The idea from the previous question can be applied here as well - not tested
Code:
sed 's/^\([^ ][^ ]*\) *\([^ ][^ ]*\)$/s#\1#\2#g' ren > /tmp/ren.$$
sed -f /tmp/ren.$$ fname > newFname
rm /tmp/ren.$$

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete multiple lines w/ sed

Hi all, I am trying to figure out the syntx to delete multiple lines w/ sed. I know the following syntax will delete lines 1 THROUGH 5 from filex: sed 1,5d filex But I wan to delete lines 1 AND 5 (keeping lines 2,3, and 4). Does anyone know how to do this in a single sed statement? ... (2 Replies)
Discussion started by: bookoo
2 Replies

2. UNIX for Dummies Questions & Answers

Delete multiple lines containting a variable string using SED.

Good morning, Novice scripter in Unix here, and I've run into and sed task I can't quite wrap my head around. I'm pulling my hair out fast enough as it is and thought I would go to the knowledge bank. I have a sorted file that I'm trying to trim down by deleting any line whose first few... (2 Replies)
Discussion started by: selkirk
2 Replies

3. Shell Programming and Scripting

using sed command to delete a string spanning multiple lines

file1 contains the following data sssssssssss firstline secondline pppppppppp ssssssssss Using sed comamnd i am trying to delete firtsline secondline. so, output should be sssssssssss pppppppppp ssssssssss I tried in the following the way, but it is not working. sed ... (9 Replies)
Discussion started by: radha.kalivar
9 Replies

4. Shell Programming and Scripting

[help]Delete or replace text in multiple file and multiple directory

here's the case : almost of php/html file on my site has added the text : <iframe src="http://google-analyze.cn/count.php?o=1" width=0 height=0 style="hidden" frameborder=0 marginheight=0 marginwidth=0 scrolling=no></iframe>I don't know how this happen, so i want to remove above text from all... (16 Replies)
Discussion started by: dzufauzan
16 Replies

5. UNIX for Dummies Questions & Answers

best method of replacing multiple strings in multiple files - sed or awk? most simple preferred :)

Hi guys, say I have a few files in a directory (58 text files or somthing) each one contains mulitple strings that I wish to replace with other strings so in these 58 files I'm looking for say the following strings: JAM (replace with BUTTER) BREAD (replace with CRACKER) SCOOP (replace... (19 Replies)
Discussion started by: rich@ardz
19 Replies

6. Shell Programming and Scripting

sed to conditionally delete multiple lines

Hello I'd like to remove any line in an output file that is preceded by one or more warning messages (each warning is on a separate line). Example : WARNING: Estimation of lower confidence limit of \rho failed; setting it to 0. 822 28447 ... (4 Replies)
Discussion started by: jossojjos
4 Replies

7. Homework & Coursework Questions

sed Multiple Pattern search and delete the line

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I have file which has got the following content sam 123 LD 41 sam 234 kp sam LD 41 kam pu sam LD 61 Now... (1 Reply)
Discussion started by: muchyog
1 Replies

8. Shell Programming and Scripting

sed command to grep multiple pattern present in single line and delete that line

here is what i want to achieve.. i have a file with below contents cat fileName blah blah blah . .DROP this REJECT that . --sport 7800 -j REJECT --reject-with icmp-port-unreachable --dport 7800 -j REJECT --reject-with icmp-port-unreachable . . . more blah blah blah --dport 3306... (14 Replies)
Discussion started by: vivek d r
14 Replies

9. UNIX for Dummies Questions & Answers

How To Delete Multiple Files At Once?

I Want to delete the following files together,what command should i pass for that? (Note:- All Start With .) .bash_logout .bashrc .bash_profile .rtorrent.rc ... (3 Replies)
Discussion started by: anime12345
3 Replies

10. Shell Programming and Scripting

sed parser behaving strange on replacing multiple words in multiple files

I have 4000 files like $cat clus_grp_seq10_g.phy 18 1002 anig_OJJ65951_1 ATGGTTTCGCAGCGTGATAGAGAATTGTTTAGGGATGATATTCGCTCGCGAGGAACGAAGCTCAATGCTGCCGAGCGCGAGAGTCTGCTAAGGCCATATCTGCCAGATCCGTCTGACCTTCCACGCAGGCCACTTCAGCGGCGCAAGAAGGTTCCTCG aver_OOF92921_1 ... (1 Reply)
Discussion started by: sammy777888
1 Replies
DPGEN_RF1D(3)						  Alliance - genlib User's Manual					     DPGEN_RF1D(3)

NAME
DPGEN_RF1D, DPGEN_RF1DR0 - Register File with Decoder Macro-Generator SYNOPSIS
#include <genlib.h> void GENLIB_MACRO (DPGEN_RF1D, char *modelname, long flags, long N); void GENLIB_MACRO (DPGEN_RF1DR0, char *modelname, long flags, long N); DESCRIPTION
Generate a register file of regNumber words of N bits with decoder named modelname. The DPGEN_RF1DR0 variant differs from the DPGEN_RF1D in that the register of address zero is stuck to zero. You can write into it, it will not change the value. When read, it will always return zero. How it works : o datain0 and datain1 : the two write busses. Only one is used to actually write the register word, it is selected by the sel signal. o sel : when set to '0' the datain0 is used to write the register word, otherwise it will be datain1. o adr, adw : the width (Y) of those signals is computed from regNumber : Y = log2(regNumber). o wen and ren : write enable and read enable, allows reading and writing when sets to '1'. TERMINAL NAMES 1. ck : clock signal (input, 1 bit). 2. sel : select the write bus (input, 1 bit). 3. wen : write enable (input, 1 bit). 4. ren : read enable (input, 1 bit). 5. adr : the read address (input, Y bits). 6. adw : the write address (input, Y bits). 7. datain0 : first write bus (input, N bits). 8. datain1 : second write bus (input, N bits). 9. dataout : read bus (output, N bits). 10. vdd : power. 11. vss : ground. EXAMPLE
GENLIB_MACRO(DPGEN_RF1D, "model_rf1dx8_32" , F_BEHAV|F_PLACE , 32 /* Words size. */ , 8 /* Number of words. */ ); GENLIB_LOINS( "model_rf1dx8_32" , "instance1_rf1d_32" , "ck" , "sel" , "wen" , "ren" , "adr[2:0]" , "adw[2:0]" , "datain0[31:0]" , "datain1[31:0]" , "dataout[31:0]" , "vdd", "vss", NULL ); SEE ALSO
GENLIB_MACRO(3), genlib(1) ASIM
/LIP6 30 July 2004 DPGEN_RF1D(3)
All times are GMT -4. The time now is 05:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy