Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Search and replace to first occurrence of string Post 302072452 by gilmord on Wednesday 3rd of May 2006 05:00:39 AM
Old 05-03-2006
Sorry, I didn't make myself clear in my original posting. The snippet of the file was tiny and the first letter isn't always 'u'. Also, I only want to add in the word average when the previous word starts with AVG_.
So as an small example the text can contain things like:

CL_SUPD;URAUPDOC;uraUpdate_Other causes;#;A
CL_SUPD;URAUPPUU;uraUpdate_3_0_1 periodic URA update;#;A
CSACT_DY;AVG_UEACT1;uesPerActiveLinkSetSize_1;#;A
CSACT_DY;AVG_UEACT2;ActiveLinkSetSize;#;A
CSACT_DY;AVG_UEACT3;uesPerActiveLinkSetSize_2;#;A
CSACT_DY;BH_ACRALLCF;acRejections all causes;#;A
CSACT_DY;BH_ACRCDALF;acRejections_1_9_8 Code allocation failure;#;A

I would like to change only the AVG_ lines to:

CL_SUPD;URAUPDOC;uraUpdate_Other causes;#;A
CL_SUPD;URAUPPUU;uraUpdate_3_0_1 periodic URA update;#;A
CSACT_DY;AVG_UEACT1;Average uesPerActiveLinkSetSize_1;#;A
CSACT_DY;AVG_UEACT2;Average ActiveLinkSetSize;#;A
CSACT_DY;AVG_UEACT3;Average uesPerActiveLinkSetSize_2;#;A
CSACT_DY;BH_ACRALLCF;acRejections all causes;#;A
CSACT_DY;BH_ACRCDALF;acRejections_1_9_8 Code allocation failure;#;A
 

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

SED replace string by occurrence

hi all, I have a text file with following content PAGENUMBER asasasa asasasa PAGENUMBER sasasasasa PAGENUMBER using sed i want to replace PAGENUMBER by occurrence count eg 1 asasasa asasasa 2 sasasasasa 3 (4 Replies)
Discussion started by: uttamhoode
4 Replies

3. UNIX for Dummies Questions & Answers

Search for a string and replace the searched string in the same position in samefile

Hi All, My requisite is to search for the string "0108"(which is the year and has come in the wrong year format) in a particular column say 4th column in a tab delimited file and then replace it with 2008(the correct year format) in the same position where 0108 was found in the same file..The... (27 Replies)
Discussion started by: ganesh_248
27 Replies

4. Shell Programming and Scripting

Search, replace string in file1 with string from (lookup table) file2?

Hello: I have another question. Please consider the following two sample, tab-delimited files: File_1: Abf1 YKL112w Abf1 YAL054c Abf1 YGL234w Ace2 YKL150w Ace2 YNL328c Cup9 YDR441c Cup9 YDR442w Cup9 YEL040w ... File 2: ... ABF1 YKL112W ACE2 YLR131C (9 Replies)
Discussion started by: gstuart
9 Replies

5. Shell Programming and Scripting

awk - replace number of string length from search and replace for a serialized array

Hello, I really would appreciate some help with a bash script for some string manipulation on an SQL dump: I'd like to be able to rename "sites/WHATEVER/files" to "sites/SOMETHINGELSE/files" within the sql dump. This is quite easy with sed: sed -e... (1 Reply)
Discussion started by: otrotipo
1 Replies

6. Shell Programming and Scripting

Replace x Number of String Occurrence with Sed

Ok, So I have a huge file that has over 12000 lines in it. in this file, there are 589 occurrences of the string "use five-minute-interval" spread in various areas in the file. How can i replace the the last 250 of the occurrences of "use five-minute-interval" with "use... (10 Replies)
Discussion started by: SkySmart
10 Replies

7. UNIX for Dummies Questions & Answers

Search for a string,delete the line and replace with new string in a file

Hi Everyone, I have a requirement in ksh where i have a set of files in a directory. I need to search each and every file if a particular string is present in the file, delete that line and replace that line with another string expression in the same file. I am very new to unix. Kindly help... (10 Replies)
Discussion started by: Pradhikshan
10 Replies

8. AIX

Replace consecutive occurrence of string in same line

Hi All, I have a requirement to replace consecutive occurence of same string nedd to be replaced. Below is the input and desired output. Input: --------- 123.5|ABC|.|.|. 234.4|DEF|.|.|.|.|.| Output: --------- 123.5|ABC|||. 234.4|DEF||||| so basically "|.|" need to be replaced with... (9 Replies)
Discussion started by: ureddy
9 Replies

9. Shell Programming and Scripting

Replace first occurrence of a string in while loop

####Solved#### Hello, My aim is to replace searched string with incremented value under ubuntu 16.04. Example: aasasasas 9030 31wwo weopwoep weerasas 9030 ew31wo ieopwoep bbqqqsas 9030 ew3swo ieeopwoep ccsaqpas 9030 ewiro o2opwoep Expected: aasasasas 9030 31wwo weopwoep weerasas 9031... (2 Replies)
Discussion started by: baris35
2 Replies

10. UNIX for Beginners Questions & Answers

Search partial string in a file and replace the string - UNIX

I have the below string which i need to compare with a file and replace this string in the file which matches closely. Can anyone help me on this. string(Scenario 1)- user::r--,user::ourfrd:r-- String(Scenario 2)- user::r-- File **** # file: /local/Desktop/myfile # owner: me # group:... (6 Replies)
Discussion started by: sarathy_a35
6 Replies
TORRUS_SCHEDULERINFO(8) 					      torrus						   TORRUS_SCHEDULERINFO(8)

NAME
schedulerinfo - Displays extended scheduler tasks information. SYNOPSIS
torrus schedulerinfo --tree=TREENAME [options...] DESCRIPTION
This utility displays the extended scheduler tasks information for tree TREENAME on standard output. This might be useful for scheduler planning and analysis. OPTIONS
--config Reports scheduler's configuration. The values are explained below. Total collector/monitor leaves: N Total number of datasources being processed by collector or monitor daemon. Scheduled leaves by type Torrus supports arbitrary number of collector types, and this report shows how many datasources belong to every type. Currently the monitor leaves are not divided into types. Least common period: N seconds The report below shows how the tasks are distributed across the time line, and the least common period shows the period of this time line. Tasks execution timeline This report tells which task and how many datasources are involved in each task startup event, and how these events are dispersed across the time. The column Interval shows the time interval from each task execution event to the next event on the timeline. --runtime Reports scheduler's runtime statistics, such as running cycle times, late starts etc. The meaning of the output values is as follows. Values that have zero values are usually not printed. Task: Name, Period: N seconds, Offset: M seconds Each scheduler task is characterized by its name (usually Collector or Monitor), period, and timeoffset. Fore example, if period is set to 300 seconds, and offset is 14 seconds, then the task would be executed at 00:00:14, 00:05:14, 00:10:14, and so on for every hour in a day. N running cycles passed How many times the task was executed since last reset. The counter is normally reset after torrus_compilexml(8) successfully compiles the configuration. N late starts How many times the task has started with a delay from its normal schedule. N too long runs How many times the task execution time was longer than its period. N overrun periods How many periods have been missed because of too long executions. N missed periods How many periods were missed because of any reason (such as other tasks delaying). Min, Max, Average, Exp Average The time values are displayed in four columns: Mimimum, Maximum and Average values since last reset, and Exponential decay value, which may be interpreted as the average for last several values. With defaults defined in torrus-config.pl, 95% of the average is calculated from last 3 values. Running Time How long the task executes each period. Late Start How long the task start was delayed. Too Long How much time the too long run took. RRD Queue In a multithreaded environment, the RRD files are writen in a background thread. This value shows the length of the RRD update queue at the beginning of each update cycle. --help Displays a help message. SEE ALSO
torrus(8), torrus_compilexml(8) NOTES
See more documentation at Torrus home page: http://torrus.org AUTHOR
Stanislav Sinyagin <ssinyagin@yahoo.com> torrus 2.03 2013-07-26 TORRUS_SCHEDULERINFO(8)
All times are GMT -4. The time now is 12:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy