Search Results

Search: Posts Made By: gsjdrr
2,205
Posted By gsjdrr
I apologize for the confusion. In Field 2,3,4,5 I...
I apologize for the confusion. In Field 2,3,4,5 I will check for the following and If I find the match I will echo the message.


ErrCodes: VLD_AB_F|VLD_CD_F|VLD_EF_F|VLD_GH_F
...
2,205
Posted By gsjdrr
First of all, I want to thank you all for your...
First of all, I want to thank you all for your wonderful support here.

The requirement changed a little bit and I could not tweak the logic, can someone assist me here.

The requirement is:
...
2,205
Posted By gsjdrr
if [ $2 == "VLD_AB_F" ] then print "Invalid AB in...
if [ $2 == "VLD_AB_F" ] then print "Invalid AB in $6"
if [ $3 == "VLD_CD_F" ] then print "Invalid CD in $6"

---for the above I want to print "Invalid AB, CD in $6"
[for all the matches the...
2,205
Posted By gsjdrr
Search multiple columns in each row
Hi All,

I have to search in multiple columns for multiple values, if the match is found then print the values as below.

Eg:

cat t1
Z|VLD_AB_P|VLD_CD_P|VLD_EF_F|VLD_GH_F|100...
12,992
Posted By gsjdrr
Thanks!!
Thanks!!
12,992
Posted By gsjdrr
Print only matching words
Hi All,

I have searched the forum and tried to print only matching(pattern) words from the file, but its printing entire line. I tried with grep -w. I am on sunsolaris.

Eg:
cat file...
5,150
Posted By gsjdrr
Nope, not working. Tried both and got the same...
Nope, not working. Tried both and got the same result.
5,150
Posted By gsjdrr
Still I see the same result. awk -F"|"...
Still I see the same result.


awk -F"|" '/^L/{tot+=$20} END { printf "%.2f",tot }' TEM1.TXT
-0.00

Data--

awk -F"|" '/^L/{print $20}' TEM1.TXT
8.05
21.35
13.68
23.34
18.71
98.95...
5,150
Posted By gsjdrr
Thanks ripat. I agree with you, but I am not a...
Thanks ripat. I agree with you, but I am not a great expert in awk and I tend to go to awk only if I can't achieve in other way :-(.

Following is the subset of data from file, the entire file...
5,150
Posted By gsjdrr
add signed and unsigned numbers- awk help
Hi All,

I have written the below to add the numbers in a column. Postive numbers are unsigned and negative numbers are signed in the file. After the below cmd I am getting -0.00 , instead of...
2,655
Posted By gsjdrr
Thanks Scrutinizer, it worked. I have further...
Thanks Scrutinizer, it worked. I have further checks to do in the same file, I thought I can enhance your guidelines and complete the script but looks like its not the case.

In each block (ABC),...
2,655
Posted By gsjdrr
Thanks for your quick response. I tried...
Thanks for your quick response.

I tried your code


awk -F'|' '{s=s$1} END{print s;gsub(/AB*C/,"",s);if(s=="")print "Syntax OK"; else print "Syntax Error"}' samplefile.dat
awk: syntax...
2,655
Posted By gsjdrr
Script to perform record format checks
Hi All,

I have a requirement to perform the following checks.

Input file is a "|" delimited file and looks like this.

A|c1|c2|c3|....
B|G1|G2|G3....
C|H1|H2|H3...
A|c4|c5|c6|.......
9,484
Posted By gsjdrr
Thanks for your inputs. As long as it takes the...
Thanks for your inputs. As long as it takes the original script I am fine.
9,484
Posted By gsjdrr
Overwrite a running shell script
Hello all,

This might be a dumb question...but i am running into this situation.

I have a shell script that is currently in running state. It has big sql's in it and will run for few days....
Showing results 1 to 15 of 15

 
All times are GMT -4. The time now is 10:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy