help with finding & replacing pattern in a file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help with finding & replacing pattern in a file
# 1  
Old 05-23-2008
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 pattern after string feD,id = .... ,
=> 00 0A 02 48 17 1E 1D 39 DE 00 0E 00
3. if found, i need to pass that value to one function,
which returns another value, that i'd like to replace with the original one.
=> function returns 36636361 and the line will looks like :
2947 domain = feD,id = 36636361,Name


Thanks for any help
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

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

2. Shell Programming and Scripting

Pattern Matching & replacing of content in file1 with file2

I have file 1 & file 2 with content mentioned below. I want to get the output as shown in file3. Requirement: check the content of column 1 & column 2, if value of column 1 in file1 matches with first column of file2 then remaining columns(2&3) of file2 should get replaced, also if value of... (4 Replies)
Discussion started by: siramitsharma
4 Replies

3. Shell Programming and Scripting

Finding a text in files & replacing it with unique strings

Hallo Everyone. I have to admit I'm shell scripting illiterate . I need to find certain strings in several text files and replace each of the string by unique & corresponding text. I prepared a csv file with 3 columns: <filename>;<old_pattern>;<new_pattern> ... (5 Replies)
Discussion started by: gordom
5 Replies

4. Shell Programming and Scripting

Finding/replacing strings in some files based on a file

Hi, We have a file (e.g. a .csv file, but could be any other format), with 2 columns: the old value and the new value. We need to modify all the files within the current directory (including subdirectories), so find and replace the contents found in the first column within the file, with the... (9 Replies)
Discussion started by: Talkabout
9 Replies

5. Shell Programming and Scripting

Finding a format in a file and replacing it

Hi, I need help in the following: I have a file in directory with mutiple comma seperated values. One of the value is a date and time format like 2012-04-10 xx:yy:zz I need to find that time format in the file and then replace it with xx:yy+1:zz and then save it as a new file and copy it to a... (3 Replies)
Discussion started by: rabh
3 Replies

6. Shell Programming and Scripting

AWK - Pattern Matching & Replacing - Performance

Experts, I am a beginner to Unix Shell Scripting We have source as a flat file which contains CTRL+F character as the delimiter. We need to count the number of records in the file (CTRL+F) to perform file validation Following command being used: awk '{cnt+=gsub(//,"&")}END {print cnt}'... (4 Replies)
Discussion started by: srivijay81
4 Replies

7. UNIX for Dummies Questions & Answers

Finding & Replacing specific Fields

All I have a very large file (aproximately 150,000) as shown below separated by pipe "|". I need to replace data in 2, 16, 17, 23 fields that are of time stamp format. My goal is to look in those fields and it ends with "000000|" then replace it with "000|". In other words, make it as 6 digit... (2 Replies)
Discussion started by: ddraj2015
2 Replies

8. Shell Programming and Scripting

replacing a pattern in a file

Hi guys, i have a pattern that i am searching in a file and i want to extract some of this pattern ... module TS1N65ULPA96X32M4 ( .... i want to extract only TS1N65ULPA96X32M4 part and i do the following sed 's/module \(x*\).*/\1/' name_of_file but this is not quite right. could... (6 Replies)
Discussion started by: ROOZ
6 Replies

9. Shell Programming and Scripting

Finding pattern & prepending a line with text

Hello Dudes, I have a task to make a unix shell script that should search for a specific TEXT in a file.If that TEXT is found, shell script should add a comment statement before that TEXT line. Ex : LINE 1 xxxxx LINE 2 xxxx CALL xxxx LINE 3 xxxx PERFORM UNTIL if i... (1 Reply)
Discussion started by: kirrushna
1 Replies

10. Solaris

finding & replacing blank rows/spaces in a file

Can anyone help me find and replace blank rows in a file with a numeric value (ie blankrow=someTxtOrNumValue), the file is over 500,000 rows long so it would need to be the quickest way as I'll need to do this for multiple files...I would be greatfull for any suggestions....thanks sample file:... (2 Replies)
Discussion started by: Gerry405
2 Replies
Login or Register to Ask a Question
GLLINESTIPPLE(3G)														 GLLINESTIPPLE(3G)

NAME
glLineStipple - specify the line stipple pattern C SPECIFICATION
void glLineStipple( GLint factor, GLushort pattern ) PARAMETERS
factor Specifies a multiplier for each bit in the line stipple pattern. If factor is 3, for example, each bit in the pattern is used three times before the next bit in the pattern is used. factor is clamped to the range [1, 256] and defaults to 1. pattern Specifies a 16-bit integer whose bit pattern determines which fragments of a line will be drawn when the line is rasterized. Bit zero is used first; the default pattern is all 1's. DESCRIPTION
Line stippling masks out certain fragments produced by rasterization; those fragments will not be drawn. The masking is achieved by using three parameters: the 16-bit line stipple pattern pattern, the repeat count factor, and an integer stipple counter s. Counter s is reset to 0 whenever glBegin is called, and before each line segment of a glBegin(GL_LINES)/glEnd sequence is generated. It is incremented after each fragment of a unit width aliased line segment is generated, or after each i fragments of an i width line segment are generated. The i fragments associated with count s are masked out if pattern bit (s / factor) mod 16 is 0, otherwise these fragments are sent to the frame buffer. Bit zero of pattern is the least significant bit. Antialiased lines are treated as a sequence of 1 * width rectangles for purposes of stippling. Whether rectagle s is rasterized or not depends on the fragment rule described for aliased lines, counting rectangles rather than groups of fragments. To enable and disable line stippling, call glEnable and glDisable with argument GL_LINE_STIPPLE. When enabled, the line stipple pattern is applied as described above. When disabled, it is as if the pattern were all 1's. Initially, line stippling is disabled. ERRORS
GL_INVALID_OPERATION is generated if glLineStipple is executed between the execution of glBegin and the corresponding execution of glEnd. ASSOCIATED GETS
glGet with argument GL_LINE_STIPPLE_PATTERN glGet with argument GL_LINE_STIPPLE_REPEAT glIsEnabled with argument GL_LINE_STIPPLE SEE ALSO
glLineWidth, glPolygonStipple GLLINESTIPPLE(3G)