Need to change a set of lines between two given Pattrens


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need to change a set of lines between two given Pattrens
# 8  
Old 03-22-2007
Try...
Code:
sed -e '/EVALUATE WS-TEMP-ATTR/,/END-EVALUATE/ s/^......./TCSCMT\*/' file1 > file2

# 9  
Old 03-22-2007
Quote:
Originally Posted by Ygor
Try...
Code:
sed -e '/EVALUATE WS-TEMP-ATTR/,/END-EVALUATE/ s/^......./TCSCMT\*/' file1 > file2


Wow that was Great......

Thansk a Lot!!!
# 10  
Old 03-22-2007
Quote:
Originally Posted by Ygor
Try...
Code:
sed -e '/EVALUATE WS-TEMP-ATTR/,/END-EVALUATE/ s/^......./TCSCMT\*/' file1 > file2

instead of 7 ' . ' s

Code:
sed -e '/EVALUATE WS-TEMP-ATTR/,/END-EVALUATE/ s/^\(.\{7\}\)/TCSCMT\*/' filename

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to change a set of characters between delimiters?

Hi all, I am trying to write a script for renaming some files and I can't understand how to replace a set of characters between delimiters with sed. The current filename is: <ID1>_<ID2>_<DATE>_<ID3>.PDF And I need to get the following: <ID1>_<ID2>_<DATE>_X01<ID2>.PDF I have tried the... (5 Replies)
Discussion started by: bartleby
5 Replies

2. Red Hat

PROC_MEM_RES how to set/unset/change

Hi all, Does anyone know how to change PROC_MEM_RES? We have a DB server with quite a few oracle instances (RAC) and we are getting critical alerts for PROC_MEM_RES. Anyone know how to increase the current setting or what we should do about it? Thanks in advance. john (2 Replies)
Discussion started by: jonnyd
2 Replies

3. Shell Programming and Scripting

Replacing certain lines with another set of lines

i have a huge script that i need to replace a bunch of lines in. in that script, i have a chunk similar to: JABABA=$(if ; then echo afafafa afafafafaf afafafafe fdfdfdfadfadl fafafafkkkk fi) I would like to replace the above chunk with: (1 Reply)
Discussion started by: SkySmart
1 Replies

4. Shell Programming and Scripting

search and replace, when found, delete multiple lines, add new set of lines?

hey guys, I tried searching but most 'search and replace' questions are related to one liners. Say I have a file to be replaced that has the following: $ cat testing.txt TESTING AAA BBB CCC DDD EEE FFF GGG HHH ENDTESTING This is the input file: (3 Replies)
Discussion started by: DeuceLee
3 Replies

5. Solaris

help me to change the character set

dears i am using solaris 10 i am facing a problem when i make setup for solaris i choose the country egypt and i select the language north america but i forget to do that the i found the date Jun written in arabic i want to change character set to written in english -rw-r--r-- 1 root ... (4 Replies)
Discussion started by: hosney00ux
4 Replies

6. UNIX for Dummies Questions & Answers

Change permission for a set of files

Hi there, I want to change from this permission -r-xr-xr-x to -r-xr-xr-- for a set of files under unix. Can someone help me to go-about doing this in one shot. Cheers, RN (2 Replies)
Discussion started by: karthickrn
2 Replies

7. UNIX for Dummies Questions & Answers

Why does set also change setenv variables?

I thought that set and setenv was easy enough to understand until I started experimenting. I noticed the same problem in a previous thread, so I will use it as an example. set command gave the following output: argv () cwd /homes/e/ee325328/assignment.2 home /homes/e/ee325328 path ( a... (2 Replies)
Discussion started by: benwj
2 Replies

8. Shell Programming and Scripting

Search between pattrens with one string in one or other line........

Hi have a lots of files with this type of code Example--1 PROCEDURE DIVISION USING AAA BBB CCC. Example--2 PROCEDURE DIVISION Some Commented Lines.... USING AAA BBB CCC. Example--3 (12 Replies)
Discussion started by: pbsrinivas
12 Replies

9. Shell Programming and Scripting

Search and insert between Pattrens...

Hi Every One... I wanted to inserted a line in between matched pattrens.. Ex... InPut File.. WRITEQ TS ************************** aaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbb cccccccccccccccccccccccc SOME PATTREN's RESP ( WS-RESP ) ... (7 Replies)
Discussion started by: pbsrinivas
7 Replies

10. Shell Programming and Scripting

Search between pattrens.

i wanted to search between pattrens so i used awk /"EXEC CICS DELETEQ TS"/,/END-IF/ but the some change is AAAAAAAA EXEC CICS DELETEQ TS IF ..... END-IF.... XXXXXx XXX IF (3 Replies)
Discussion started by: pbsrinivas
3 Replies
Login or Register to Ask a Question