Sponsored Content
Top Forums Shell Programming and Scripting Sed and replacing one occurence of pattern Post 302215502 by ss9u on Wednesday 16th of July 2008 01:44:25 PM
Old 07-16-2008
I am interested in the first instance of the pattern.
example : I want to replace "90 rotate" with "270 rotate"
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help in sed command ( Replacing a pattern inside a file with a variable value )

Hello, The following sed command is giving error sed: -e expression #1, char 13: unknown option to `s' The sed command is echo "//-----" | sed "s/\/\/---*/$parChk/g" where parChk="//---ee-" How can i print the variable value from sed command ? And is it possible to replace a... (2 Replies)
Discussion started by: frozensmilz
2 Replies

2. Shell Programming and Scripting

Replacing nth occurence

Hi My input file is like this for eg: abc abc abc abc abc abc i would like to replace "abc" with "cba" where the occurrence is divisible by 2 of eg here 2nd, 4th and 6th occurence shud be replace can anyone suggest in awk or sed (11 Replies)
Discussion started by: raghav288
11 Replies

3. Shell Programming and Scripting

Replacing or removing a long list of pattern by using awk or sed

Input: >abc|123456|def|EXIT| >abc|203456|def|EXIT2| >abc|234056|def|EXIT3| >abc|340056|def|EXIT4| >abc|456000|def|EXIT5| . . . Output: def|EXIT| def|EXIT2| def|EXIT3| def|EXIT4| def|EXIT5| . . My try code: (9 Replies)
Discussion started by: patrick87
9 Replies

4. Shell Programming and Scripting

Replacing the last occurence of a expression in every line

I have a file which contains /RdWrCtrl/IRdWrRepCtl/XI3/XIrdOutEnRdSbComb\/XRdDataGaterEnx /RdWrCtrl/IRdWrRepCtl/XI3/XIrdOutEnRdSbComb\/XRdDataGaterEnx /RdWrCtrl/IRdWrRepCtl/XI3/XIrdOutEnRdSbComb\/XRdDataGaterEnx /RdWrCtrl/IRdWrRepCtl/XI3/XIrdOutEnRdSbComb\/XRdDataGaterEnx I have... (7 Replies)
Discussion started by: naveen@
7 Replies

5. Shell Programming and Scripting

sed - replacing on the right of a pattern and looking for exact word?

how would you get SED to do the following, say you have the following lines in a text file: user=tigger some text some text some text some text some text some text user=ted some text some text some text some text some text some text user=thekingofrockandroll you want to find any line... (15 Replies)
Discussion started by: rich@ardz
15 Replies

6. Shell Programming and Scripting

help - sed - insert space between string of form XxxAxxBcx, without replacing the pattern

If the string is of the pattern XxxXyzAbc... The expected out put from sed has to be Xxx Xyz Abc ... eg: if the string is QcfEfQfs, then the expected output is Qcf Ef Efs. If i try to substitute the pattern with space then the sed will replace the character or pattern with space,... (1 Reply)
Discussion started by: frozensmilz
1 Replies

7. Shell Programming and Scripting

Replacing part of a pattern in sed

Hi I have a piece of xml that has a pattern like this <int>159</int><int>30</int> I want to find this pattern but only substitute the second part of the pattern to {rid1}. Is that possible in sed ? Thanks. ---------- Post updated at 12:10 PM ---------- Previous update was at 12:01 PM... (11 Replies)
Discussion started by: vnn
11 Replies

8. Shell Programming and Scripting

sed command for copying the contents of other file replacing it another file on specifc pattern

We have 2 file XML files - FILE1.XML and FILE2.xml - we need copy the contents of FILE1.XML and replace in FILE2.xml pattern "<assignedAttributeList></assignedAttributeList>" FILE1.XML 1. <itemList> 2. <item type="Manufactured"> 3. <resourceCode>431048</resourceCode> 4. ... (0 Replies)
Discussion started by: balrajg
0 Replies

9. Shell Programming and Scripting

Replacing lines matching a multi-line pattern (sed/perl/awk)

Dear Unix Forums, I am hoping you can help me with a pattern matching problem. What am I trying to do? I want to replace multiple lines of a text file (that match a multi-line pattern) with a single line of text. These patterns can span several lines and do not always have the same number of... (10 Replies)
Discussion started by: thefang
10 Replies

10. Shell Programming and Scripting

Extract whole word preceding a specific character pattern with first occurence of the pattern

Hello. Here is a file contents : declare -Ax NEW_FORCE_IGNORE_ARRAY=(="§" ="§" ="§" ="§" ="§" .................. ="§"Here is a pattern =I want to extract 'NEW_FORCE_IGNORE_ARRAY' which is the whole word before the first occurrence of pattern '=' Is there a better solution than mine :... (3 Replies)
Discussion started by: jcdole
3 Replies
PROTATE(1)						      General Commands Manual							PROTATE(1)

NAME
protate - rotate a RADIANCE picture. SYNOPSIS
protate [ -c ][ -r ] input [ output ] DESCRIPTION
Protate rotates a RADIANCE picture 90 degrees. This is useful for output on hardcopy devices with aspect ratios opposite to the input pic- ture. By default, the image is rotated clockwise. The -r option may be used to rotate the image counter-clockwise instead. The -c option indicates that the action is to correct an improper original image orientation, thus the recorded scanline ordering should not be changed. NOTES
To rotate an image 180 degrees, use pflip(1) with both the -h and -v options. AUTHOR
Greg Ward SEE ALSO
getinfo(1), pcompos(1), pfilt(1), pflip(1), psign(1), rpict(1) RADIANCE
10/27/98 PROTATE(1)
All times are GMT -4. The time now is 03:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy