Sponsored Content
Top Forums Shell Programming and Scripting replacing a pattern in a file Post 302204058 by ROOZ on Tuesday 10th of June 2008 12:22:27 PM
Old 06-10-2008
i forgot to ask another question related to this one,
how could i replaced the number 96 and 32 within TS1N65ULPA96X32M4
with some variables that i have.
i was wondering if i could use something like
sed 's/ TS1N65ULPA96X32M4/ TS1N65ULPA$VARIABLE1X$VARIABLE2M4/'
but this obviously does not work
could someone help me with this one too. i posted the two questions here because they are relevant to each other
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replacing a paragraph between pattern , with the content 4m another file

hi, i wanted to put the output of file f1 into the pattern space of file f2 f1: wjwjwjwjwjwjwj //these line go in file f2 jwjwjwjwjwjjwjw wjwjwjwjjwjwjwj f2: Pattern_start __________ //these are the line to be replaced __________ Pattern_end i m... (4 Replies)
Discussion started by: go4desperado
4 Replies

2. Shell Programming and Scripting

help with finding & replacing pattern in a file

Hi everyone. Could u be so kind and help me with on "simple" shell script? 1. i need to search a file line by line for a pattern. example of a lines in that file 2947 domain = feD,id = 00 0A 02 48 17 1E 1D 39 DE 00 0E 00,Name Values:snNo = f10 Add AttFlag = 0 2. i need to find... (0 Replies)
Discussion started by: dusoo
0 Replies

3. 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

4. Shell Programming and Scripting

Create a file after replacing a particular pattern in another file

I have a file as below: file1 ----- 1|CT1909090TRYGH 2|CTH909090GHDGJ 4|CT9909090HSGUS 10|AT0735732YQGDJ 21|CTP909090BAFSL 100|BAI891253NSHDD Now, I have to replace "909090" to "451234". Since after the pipe delimiter, the field positions are fixed, so i tried the below command: awk... (5 Replies)
Discussion started by: PriyankaM
5 Replies

5. Shell Programming and Scripting

Replacing pattern

Hi, I have a file which contains the below data. I want to search for a pattern server="http://bushby.mis.amat.com:12440" and remove it from the file. Please let me know how can i do this. <Object name="reverse-proxy-/endeavour/"> ObjectType fn="http-client-config" timeout="1800"... (6 Replies)
Discussion started by: Krrishv
6 Replies

6. 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

7. Shell Programming and Scripting

replacing pattern

hi, I want to do replacing of some pattern by using sed. pattern : " white space / to white space / please help -bhrat (3 Replies)
Discussion started by: bhrat kapoor
3 Replies

8. Shell Programming and Scripting

Replacing a pattern in different cases in different columns with a single pattern

Hi All I am having pipe seperated inputs like Adam|PeteR|Josh|PEter Nick|Rave|Simon|Paul Steve|smith|PETER|Josh Andrew|Daniel|StAlin|peter Rick|PETer|ADam|RAVE i want to repleace all the occurrence of peter (in any case pattern PeteR,PEter,PETER,peter,PETer) with Peter so that output... (5 Replies)
Discussion started by: sudeep.id
5 Replies

9. Shell Programming and Scripting

Finding the pattern and replacing the pattern inside the file

i have little challenge, help me out.i have a file where i have a value declared and and i have to replace the value when called. for example i have the value for abc and ccc. now i have to substitute the value of value abc and ccc in the place of them. Input File: go to &abc=ddd; if... (16 Replies)
Discussion started by: saaisiva
16 Replies

10. Shell Programming and Scripting

Pattern replacing

Hi, I have a text file with lots of text (strings,numbers,special characters etc). I am trying to replace any occurrence of these strings : 90% 91% 92% .... 100% I want to replace them with : "90%" "91%" "92%" .... "100%" I am now using 10 sed commands for replacement but I... (12 Replies)
Discussion started by: ctrld
12 Replies
tt_pattern_user(library call)											     tt_pattern_user(library call)

NAME
tt_pattern_user -- return the value in a user data cell for a pattern object SYNOPSIS
#include <Tt/tt_c.h> void *tt_pattern_user( Tt_pattern p, int key); DESCRIPTION
The tt_pattern_user function returns the value in the indicated user data cell for the specified pattern object. Every pattern object allows an arbitrary number of user data cells that are each one word in size. The user data cells are identified by integer keys. The tool can use these keys in any manner to associate arbitrary data with a pattern object. The user data is part of the pattern object (that is, the storage buffer in the application); it is not part of the actual pattern. The content of user cells has no effect on pattern matching. The p argument is a unique handle for a message pattern. This handle is returned after tt_pattern_create is called. The key argument is the specified user data cell. The application can use tt_pattern_user_set(3) to assign the keys to the user data cells that are part of the pattern object. The value of each data cell must be unique for this pattern. RETURN VALUE
Upon successful completion, the tt_pattern_user function returns the data cell, a piece of arbitrary user data that can hold a void *. The application can use tt_ptr_error(3) to extract one of the following Tt_status values from the returned data: TT_OK The operation completed successfully. TT_ERR_NOMP The ttsession(1) process is not running and the ToolTalk service cannot restart it. TT_ERR_POINTER The pointer passed does not point to an object of the correct type for this operation. APPLICATION USAGE
The user data cell is intended to hold an address. If the address selected is equal to one of the Tt_status enumerated values, the result of the tt_ptr_error(3) function will not be reliable. SEE ALSO
Tt/tt_c.h - Tttt_c(5), tt_pattern_user_set(3), tt_pattern_create(3), tt_ptr_error(3). tt_pattern_user(library call)
All times are GMT -4. The time now is 05:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy