10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I am using Solaris 5.10 & ksh
Wanted to loop through a pattern file by reading it and passing it to the awk to match that value present in column 1 of rawdata.txt , if so print column 1 & 2 in to Avlblpatterns.txt. Using the following code but it seems some mistakes and it is running for... (2 Replies)
Discussion started by: ananan
2 Replies
2. Shell Programming and Scripting
Hi Guys,
Need your urgent support please. I have a file with 3 separate strings separated by a comma and 2nd file which has a sentence where I can find these 3 strings. I need to find sentences which do not have these strings and maybe redirect it to a 3rd file.
All the 3 strings will occur... (3 Replies)
Discussion started by: danish0909
3 Replies
3. Shell Programming and Scripting
Coins.txt:
gold 1 1986 USA American Eagle
gold 1 1908 Austria-Hungary Franz Josef 100 Korona
silver 10 1981 USA ingot
gold 1 1984 Switzerland ingot
gold 1 1979 RSA Krugerrand
gold 0.5 1981 RSA Krugerrand
gold 0.1 1986 PRC Panda
silver 1 1986 USA Liberty dollar
gold 0.25 1986 USA Liberty... (2 Replies)
Discussion started by: Ramesh M
2 Replies
4. UNIX for Dummies Questions & Answers
Hi all !
I have 2 files:
file1:
1|AAA|123456
2|BBB|098765432
...
file2:
-|klk|AAA|$123.00|Qty.2|US
-|opi|EEE|$23.00|Qty.4|US
...
Output:
1|AAA|-|klk|AAA|$123.00|Qty.2|US
I would need to search the 3rd field of file2 for the patterns contained in the 2nd field of file1.
And... (10 Replies)
Discussion started by: beca123456
10 Replies
5. Shell Programming and Scripting
Hi,
I am new to shell scripting and is working on a script to extract lines from a log file between two time stamps using awk command. After some research I used following command:
awk '/01 Oct 2011/{p=1} /10 Oct 2011/{p=0} p' test.log >> tmp.log
This works fine. But now i want to... (3 Replies)
Discussion started by: davidtd
3 Replies
6. 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
7. Shell Programming and Scripting
Hi all,
In a script like :
job_date=....
ls -l 2>/dev/null |
awk -v var =$job_date '
/Name\.Version\.+\.xml$/ {
How can i include a script variable job_date store in "var" in the pattern "/Name\.Version\.+\.xml$/"
Thanks in advance (12 Replies)
Discussion started by: abhinav192
12 Replies
8. Shell Programming and Scripting
Hello friends,
I couldnt connect two search patterns in awk, what i want is to search for two words in a log file;
"+MB)" and "Done"
i use this code
/usr/xpg4/bin/awk '/+MB)/ {gsub("\(","",$5);print int($5)}' mylog.txt
and i get integer part of (123,45MB) in a log file "mylog" with ... (1 Reply)
Discussion started by: EAGL€
1 Replies
9. Shell Programming and Scripting
Good day, great gurus,
I'm new to Perl, and programming in general. I'm trying to retrieve a column of data from my text file which spans a non-specific number of lines. So I did a regexp that will pick out the columns. However,my pattern would vary. I tried using a foreach loop unsuccessfully.... (2 Replies)
Discussion started by: Sp3ck
2 Replies
10. UNIX for Dummies Questions & Answers
I have one file:
123*100*abcd*10
123*101*abcd*-29*def
123*100*abcd*-10
123*102*abcd*-105*asd
I would like to parameterize the search patterns in the following way so that the user could dynamically change the search pattern.
*100* and *- (ie *minus)
*102* and *-
The output that is... (6 Replies)
Discussion started by: augustinep
6 Replies