10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I'm facing a problem
1) I got a list_file intended to be used for inlace replacement like this
Replacement pattern ; Matching patterns
EXTRACT ___________________
toto ; tutu | tata | tonton | titi
bobo ; bibi | baba | bubu | bebe
etc. 14000 lines !!!
... (5 Replies)
Discussion started by: mpvphd
5 Replies
2. 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
3. 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
4. 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
5. Shell Programming and Scripting
Hi,
I wasn't quite sure how to title this one! Here goes:
I have some already partially parsed log files, which I now need to extract info from. Because of the way they are originally and the fact they have been partially processed already, I can't make any assumptions on the number of... (8 Replies)
Discussion started by: chrissycc
8 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. Shell Programming and Scripting
Hi,
I am using sub to remove blank spaces and one pattern(=>) from the input string. It works fine when I am using two sub functions for the same. However it is giving error while I am trying to remove both spaces and pattern using one single sub function.
Working:
$ echo " OK => " |awk... (2 Replies)
Discussion started by: sai_2507
2 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
I would like to print result of multiple search pattern invoked from an one liner. The code looks like this but won't work
gawk -F '{{if ($0 ~ /pattern1/) pat1=$1 && if ($0 ~ /pattern2/) pat2=$2} ; print pat1, pat2}'
Can anybody help getting the right code? (10 Replies)
Discussion started by: sdf
10 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