Hello, wondering if anybody may be help me. This is the output of a file, from which I need to display a number of fields regarding which users are using licences for two applications we run. Lines which end with "(linger: 1800)" denote licence use for one application and lines which don't contain this denote licence use of the other.
I need to be display fields $4, $8, $9, $11 and $12, which I have been able to do. The problem I have though, is that in my output, I need to be able to substitute "(linger: 1800)" with "ChangeBase" and for lines which don't contain "(linger: 1800)" I want to display "CMBase".
In addition to that, I need to read field $4 (user ID) of each line and perform a ypmatch command against it, so I can display the name of the user at the end of each line.
If anybody has any suggestions or pointers, it would be much appreciated.
This is the desired output.
I already have a shell script and a couple of awk scripts which worked fine and displayed all of the above with the exception of "User Name".
These scripts as follows:
Script cmsynergy_licence_admin.sh
Hi,
So awk is driving me crazy on this one. I have searched everywhere and read man, docs and every related post Google can find and still no luck. The actual files I need to run this on are sensitive in nature, but it is the same thing as if I needed to calculate weighted grades for multiple... (15 Replies)
In the awk below I am trying to copy the entire contents of $6 there may be multiple values seperated by a ;, to $8, if $8 is . (lines 1 and 3 are examples). If that condition $8 is not . (line2 is an example) then that line is skipped and printed as is. The awk does execute but prints the output... (3 Replies)
In the awk below I am trying to set/update the value of $14 in file2 in
bold, using the matching NM_ in $12 or $9 in file2
with the NM_ in $2 of file1.
The lengths of $9 and $12 can be variable but what is consistent is the start pattern
will always be NM_ and the end pattern is always ;... (2 Replies)
In the out.txt below I am trying to use awk to update the contents of $9.. If $9 contains a + or - then $8 of out.txt is used as a key to lookup in $2 of file. When a match ( there will always be one) is found the $3 value of that file is used to update $9 of out.txt separated by a :. So the... (6 Replies)
First, thanks for the help in previous posts... couldn't have gotten where I am now without it!
So here is what I have, I use AWK to match $1 and $2 as 1 string in file1 to $1 and $2 as 1 string in file2. Now I'm wondering if I can extend this AWK command to incorporate the following:
If $1... (4 Replies)
Hi All,
my requirement is as below.
I need to replace a value in a particular column with a substitution variable(date value) and modified value of the current column value in the same position.
for ex.
i have a record like
02;aaaa;bbbbb;cccccc;dddddd;123456789;hhhhh;12hs;asdf ;... (3 Replies)
Hi, all
I need to get fields in a line that are separated by commas, some of the fields are enclosed with double quotes, and they are supposed to be treated as a single field even if there are commas inside the quotes.
sample input:
for this line, 5 fields are supposed to be extracted, they... (8 Replies)
Hi all u brilient people on the forum...
I am trying to call the variable value in awk command for search pattern /start/,/stop/ but i am nt able to do this ....
wat i did is ..i have created two variable YESTERDAY and TODAY and passed the y'day n 2'days dates in it...like this
... (14 Replies)
I have 2 files with a common parm - Jobname
File 1
0507 1202 JOBA
0507 1302 JOBB
0507 1452 JOBC
0507 1552 JOBA
0507 1553 JOBA
File2
JOBA abcdefg server4
JOBB defghij server22
JOBC vwxyz12 server55
I would like to take each line from File1 and match the jobname with the jobname... (8 Replies)
Hi all,
I have searched and found various threads about removing spaces from a field within a text file. Unfortunately, I have not found exactly what I'm looking for, nor am I adept enough to modify what I've found into what I need.
I use the following command to remove the first line... (3 Replies)