Sponsored Content
Top Forums Shell Programming and Scripting Multiple Line awk search and replace Post 302850279 by bobbygb2003 on Thursday 5th of September 2013 08:35:22 AM
Old 09-05-2013
Hey Shamrock, I was trying to describe what I tried. If you look at the first two occurrences, the difference is in the third line, either positive or negative. If the word positive shows up in the third line then I want the middle line to change to !t_bypass && rstq_b, and if negative shows up, then I want to change it to t_bypass && rstq_b. If neither show up, as in the third occurrence, then I want to do nothing.

What I want to do is get from the start point that I posted to the end point, keeping in mind that I do know the which of these two sections will come first in the log that I am reading:
Code:
        related_pin : "t_bypass";
        sdf_cond : "rstq_b";
        timing_sense : positive_unate;
 
        related_pin : "t_bypass";
        sdf_cond : "rstq_b";
        timing_sense : negative_unate;

---------- Post updated 09-05-13 at 08:35 AM ---------- Previous update was 09-04-13 at 12:36 PM ----------

Anybody have any ideas? I have tried using sed and awk but no luck.

Last edited by Franklin52; 09-05-2013 at 03:38 AM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl: Search for string on line then search and replace text

Hi All, I have a file that I need to be able to find a pattern match on a line, search that line for a text pattern, and replace that text. An example of 4 lines in my file is: 1. MatchText_randomNumberOfText moreData ReplaceMe moreData 2. MatchText_randomNumberOfText moreData moreData... (4 Replies)
Discussion started by: Crypto
4 Replies

2. Shell Programming and Scripting

Does Sed Search/Replace Work For Multiple Matches On The Same Line?

Hello, I would like to delete all the footnotes in all my htm files. Hence, I have to delete the whole font tag pairs, i.e. deleting everything between the begin/end font tags. I create a testfile, of which data parts of all four lines are the same except for the number of font tag pairs,... (3 Replies)
Discussion started by: cibalo
3 Replies

3. Shell Programming and Scripting

perl search and replace - search in first line and replance in 2nd line

Dear All, i want to search particular string and want to replance next line value. following is the test file. search string is tmp,??? ,10:1 "???" may contain any 3 character it should remain the same and next line replace with ,10:50 tmp,123 --- if match tmp,??? then... (3 Replies)
Discussion started by: arvindng
3 Replies

4. Shell Programming and Scripting

awk multiple-line search and replace one-liner

Hi I am trying to search and replace a multi line pattern in a php file using awk. The pattern starts with <div id="navbar"> and ends with </div> and spans over an unknown number of lines. I need the command to be a one liner. I use the "record separator" like this : awk -v... (8 Replies)
Discussion started by: louisJ
8 Replies

5. Shell Programming and Scripting

awk + gsub to search multiple input values & replace with located string + extra text

Hi all. I have the following command that is successfully searching for any one of the strings on all lines of a file and replacing it with the instructed value. cat inputFile | awk '{gsub(/aaa|bbb|ccc|ddd/,"1234")}1' > outputFile This does in fact replace any occurrence of aaa, bbb,... (2 Replies)
Discussion started by: dazhoop
2 Replies

6. Shell Programming and Scripting

awk delete/remove rest of line on multiple search pattern

Need to remove rest of line after the equals sign on search pattern from the searchfile. Can anybody help. Couldn't find any similar example in the forum: infile: 64_1535: Delm. = 86 var, aaga 64_1535: Fran. = 57 ex. ccc 64_1639: Feb. = 26 (link). def 64_1817: mar. = 3/4. drz ... (7 Replies)
Discussion started by: sdf
7 Replies

7. Shell Programming and Scripting

Search & Replace: Multiple Strings / Multiple Files

I have a list of files all over a file system e.g. /home/1/foo/bar.x /www/sites/moose/foo.txtI'm looking for strings in these files and want to replace each occurrence with a replacement string, e.g. if I find: '#@!^\&@ in any of the files I want to replace it with: 655#@11, etc. There... (2 Replies)
Discussion started by: spacegoose
2 Replies

8. Shell Programming and Scripting

awk to search for specific line and replace nth column

I need to be able to search for a string in the first column and if that string exists than replace the nth column with "-9.99". AW12000012012 2.38 1.51 3.01 1.66 0.90 0.91 1.22 0.82 0.57 1.67 2.31 3.63 0.00 AW12000012013 1.52 0.90 1.20 1.34 1.21 0.67 ... (14 Replies)
Discussion started by: ncwxpanther
14 Replies

9. Shell Programming and Scripting

Multiple line search, replace second line, using awk or sed

All, I appreciate any help you can offer here as this is well beyond my grasp of awk/sed... I have an input file similar to: &LOG &LOG Part: "@DB/TC10000021855/--F" &LOG &LOG &LOG Part: "@DB/TC10000021852/--F" &LOG Cloning_Action: RETAIN &LOG Part: "@DB/TCCP000010713/--A" &LOG &LOG... (5 Replies)
Discussion started by: KarmaPoliceT2
5 Replies

10. UNIX for Dummies Questions & Answers

Using awk to multiple and replace in a specific line

Hi Folks, I have the file in which I need to multiply the content of a line and replace the initial content of that line with the obtained answer. For example if this is my input file file1.txt 2.259314750 xxxxxx 1.962774350 xxxxxx 2.916817290 xxxxxx 1.355026900 ... (4 Replies)
Discussion started by: Madiouma Ndiaye
4 Replies
ITECONFIG(8)						    BSD System Manager's Manual 					      ITECONFIG(8)

NAME
iteconfig -- modify console attributes at run time SYNOPSIS
iteconfig [-i] [-f file] [-v volume] [-p pitch] [-t msec] [-w width] [-h height] [-d depth] [-x offset] [-y offset] [color ...] DESCRIPTION
iteconfig is used to modify or examine the attributes of the console bell and bitmapped console display. The console bell's volume, pitch, and count may be specified, as well as the bitmapped display's width, height, horizontal and vertical offset, pixel depth, and color map. The following flags are interpreted by iteconfig: -i After processing all other arguments, print information about the console's state. -f Open and use the terminal named by file rather than the default console /dev/ttye0. -v Set the volume of the console bell to volume, which must be between 0 and 63, inclusive. -p Set the pitch of the console bell to pitch, which must be between 10 and 1399. -t Set the duration of the beep to msec milliseconds which must be between 1 and 5000 (5 seconds). -w Set the width of the console display to width pixel columns. Width must be a positive integer. -h Set the height of the console display to height pixel rows. Height must be a positive integer. -d Set the number of bitplanes the console view should use to depth. For example, if depth is 3 then 8 colors will be used. -x Set the horizontal offset of the console view on the monitor to offset pixel columns. The horizontal offset may be a positive or a negative integer, positive being an offset to the right, negative to the left. -y Set the vertical offset of the console view on the monitor to offset pixel rows. The vertical offset may be a positive or a negative integer, positive being an offset down, negative up. Any additional arguments will be interpreted as colors and will be used to supply the color values for the console view's color map, starting with the first entry in the map. (See the COLOR SPECIFICATION section of this manual page for information on how to specify colors.) If more colors are supplied than are usable by the console view, a warning is printed and the extra colors are ignored. COLOR SPECIFICATION
Colors are hexadecimal numbers which have one of the following formats: 0xRRGGBB RR, GG, and BB are taken to be eight-bit values specifying the intensities of the red, green and blue components, respectively, of the color to be used. For example, 0xff0000 is bright red, 0xffffff is white, and 0x008080 is dark cyan. 0xGG GG is taken to be an eight-bit value specifying the intensity of grey to be used. A value of 0x00 is black, a value of 0xff is white, and a value of 0x80 is a grey approximately half way in between. 0xM M is taken to be the one-bit monochrome value to be used. A value of 0x1 is black, and a value of 0x0 is white. BUGS
The iteconfig command is only available on the amiga and atari ports. BSD
February 3, 1994 BSD
All times are GMT -4. The time now is 03:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy