Don thank you very very much for your help, it is working nearly to perfection
My appologies if I donīt give all info at once, I am quite newbie to this as I mention, and just learning as I go along.....
Your solution works perfect, the only thing I am not very clear is how I can add a specific range for a specific line, is that possible?
Say I would only want to change thresholds for EH.ERROR.ADB_INSERT but not EH.ERROR.ADB_UPDATE, I tried this but does not work
I tried this but did not work....
Again, thank you very much for your time and patience with this newbie :P
The EREs in the dom[] array must be ordered such that a specific line's 1st field will match the line you want to be treated specially. Since the ERE .* will match any string, this entry must be last in the list. This line provides the default values for domains not matched by any other domains you define.
If you wanted an entry for an exact match against EH.ERROR.ADB_INSERT with one set of values and another set of values for other entries starting with EH. (as in your first example) in addition to your entries for values starting with ERP. and everything else, you would want something like:
I changed the script to use ndom and ndom++ as subscripts while initializing the dom[] and rm[]arrays above, so it should be easier to add, move, and remove domains. Your last message wasn't clear as to whether you still wanted a general case for domains starting with "EH." as well as a different setting for "EH.ERROR.ADB_INSERT" or if you wanted the other lines starting with "EH." to use the last (default) ranges.
Note that since the extended regular expressions ^EH\.ERROR\.ADB_INSERT$, ^EH\. , and .* all match the string "EH.ERROR.ADB_INSERT", the 1st ERE must be in the table before the other two for the script to use use the ranges assigned to that domain.
With the above code, the output produced for the input above is:
If you remove the two lins in red in the script above, the output will be:
with the line changed by removing that domain highlighted in red above.
Hello,
Can someone please help in below requirement.
My requirement is to add date before to first column,some text before 1st,2nd coulmns and insert a new column in between 2 and 3 columns.
input file.
aa 123 dddd
aa 667 kdkdk
ddj 738 kkkk
aa 123 dddd
aa 667 ... (5 Replies)
Hi Folks,
I have a text file with lots of rows with duplicates in the first column, i want to filter out records based on filter columns in a different filter text file.
bash scripting is what i need.
Data.txt
Name OrderID Quantity
Sam 123 300
Jay 342 498
Kev 78 2500
Sam 420 50
Vic 10... (3 Replies)
Hi,
I am not so familiar with bash scripting and would appreciate your help here.
I have a text file 'input.txt' like this:
2 3 4
5 6 7
8 9 10
I want to store each column in an array like this
a ={2 5 8}, b={3 6 9}, c={4 7 10}
so that i can access any element, e.g b=6 for the later use. (1 Reply)
Hi,
I would like to add a new column containing the row numbers to a text file. How do I go about doing that? Thanks!
Example input:
A X
B Y
C D
Output:
A X 1
B Y 2
C D 3 (5 Replies)
Hi,
I have a tab delimited text file with three different columns. I want to add an extra column to the text file. The extra column will be the second column and it will equal third column - 1. How do I go about doing that? Thanks!
Input:
chr1 788822 rs11240777
chr1 1008567 rs9442372... (2 Replies)
I have a space delimited text file with two columns. I would like to add NA to the first column of the text file.
Input:
19625 10.4791768259
19700 10.8146489183
19701 10.9084026759
19702 10.9861346978
19703 10.9304364984
Output:
NA19625 10.4791768259
NA19700 10.8146489183... (1 Reply)
Hi All ,
Kindly help me with this soln
awk '{printf "%s %7s \n", $1,$c}' infile
where
value of variable c I am externally giving input
But executing the above command shows all the columns of infile where as I want only 1st column of infile and 2nd column should print value c (8 Replies)
Good afternoon to everyone,
I have some input and output from various widgets that I am trying to get to play nicely together. Basically I would like to stay out of excel and be able to automate the entire process. I have read some posts here about how to use awk, nawk, etc, to do similar... (9 Replies)
Dear all,
Does anyone know how I could to add a column of numbers (1s, or 2s, or..., or 6s) to two-column text files (tab-delimited), where the specific number to be added varies as a function of the file naming?
Currently, each of my text files has two columns, so the column with the... (12 Replies)
Hi,
I want to write a shell script which increments a particular column in a row from a text file and then adds another row below the current row with the incremented value .
For Eg .
if the input file has a row :
abc xyz lmn 89 lm nk o p
I would like the script to create something like... (9 Replies)