10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello all,
I have since given up trying to figure this out and used sed instead, but I am trying to understand awk and was wondering how someone might do this in awk.
I am trying to match on the first field of a specific file with the first field on multiple files, and append the second field... (2 Replies)
Discussion started by: karlmalowned
2 Replies
2. Shell Programming and Scripting
I need to check if 2 values exists in the file and if they are equal print 0.
output.txt:
------------
1 2 3 4 5 6
Inputs:
a=1
b=2
My pattern matching code works but I am trying to set a counter if both the pattern matches which does not work.If the count > 0,then I want to... (3 Replies)
Discussion started by: kannan13
3 Replies
3. Shell Programming and Scripting
Hi forum,
Can you please help me understand how to look for and replace the below pattern (containing line breaks) and return a new result?
Rules: Must match the 3 line pattern and return a 1 line result.
I have found solutions with sed, but it seems that sed installed in my system is... (5 Replies)
Discussion started by: demmel
5 Replies
4. Shell Programming and Scripting
Hi,
I'm getting stuck when supplying multiple patterns for the below code:
awk -F, '
..
..
if ($0 ~ pattern)
{ .. .. }
..
..
' pattern='$ROW' input_file
for the same code I'm trying to supply multiple patterns as given below:
awk -F, '
..
..
if( ($0 ~ pattern) && ($0 ~... (6 Replies)
Discussion started by: penqueen
6 Replies
5. UNIX for Dummies Questions & Answers
Hi,
We have created a script that would accept the an indicator as a parameter and archive files present in a directory. The indicator would drive what the name pattern of the files to be archived should be.
If the indicator is 1, then the pattern to look out for is FACT*.
If the indicator is... (2 Replies)
Discussion started by: jerome_rajan
2 Replies
6. Shell Programming and Scripting
Hello,
I have the following input file:
qh1adm 20130710111201 : tp import all QH1 u6 -Dsourcesystems=BFI,EBJ
qh1adm 20130711151154 : tp import all QH1 u6 -Dsourcesystems=BFI,EBJ
qx1adm 20130711151154 : tp count QX1 u6 -Dsourcesystems=B17,E17,EE7
qh1adm 20130711151155 : tp import all... (7 Replies)
Discussion started by: kcboy
7 Replies
7. UNIX for Dummies Questions & Answers
Hi Folks,
I have two arrays
a:
aaa bbb ccc ddd
ddd aaa bbb ccc
ddd ccc aaa bbb
b:
aaa bbb ccc
aaa ccc bbb
bbb aaa ccc
ccc bbb aaa
I want to compare row by row a(c1:c4) to b(c1:c3). If elements of 'b' match... (5 Replies)
Discussion started by: heecha
5 Replies
8. Shell Programming and Scripting
Hi,
I have a file that is 430K lines long. It has records like below
|site1|MAP
|site2|MAP
|site1|MODAL
|site2|MAP
|site2|MODAL
|site2|LINK
|site1|LINK
My task is to count the number of time MAP, MODAL, LINK occurs for a single site and write new records like below to a new file
... (5 Replies)
Discussion started by: reach.sree@gmai
5 Replies
9. Shell Programming and Scripting
Guys,
I am trying the following:
i have a log file of a webbap which logs in the following pattern:
2011-08-14 21:10:04,535 blablabla ERROR blablabla
bla
bla
bla
bla
2011-08-14 21:10:04,535 blablabla ERROR blablabla
bla
bla
bla
... (6 Replies)
Discussion started by: ppolianidis
6 Replies
10. UNIX for Dummies Questions & Answers
Hi there,
We have been given a bit of coursework using awk on html pages. Without giving too much away and risking the wrath of the plagerism checks, I can say we need to deal with certain html elements.
There may be several of these elements on one line. My question is, if there are more... (1 Reply)
Discussion started by: Plavixo
1 Replies