10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I have to display only those subscribers which are in "unconnected state" and the date is 90 days older than today's date.
Below command is used for this purpose:
cat vfsubscriber_20170817.csv | sed -e 's/^"//' -e '1d' | \
nawk -F '",' '{if ( (substr($11,2,4) == 2017) && ( substr($11,2,8)... (1 Reply)
Discussion started by: dia
1 Replies
2. Shell Programming and Scripting
I am trying to write a simple function to select values from a database and assign them to variables. It can have any number of arguments sent into it, and I want to assign the value retrieved to a different variable name for each argument sent in. So my code looks something like this:
... (6 Replies)
Discussion started by: DJR
6 Replies
3. Shell Programming and Scripting
Hi All,
I have a doubt in awk print exp.
Where in some awk commands have seen a digit 1 appended at the end of the awk ,didnt remember the command .
like ..
cat file |awk '{print }1'
Could some one help in understanding these cases where we use them.
Regards,
Ganesh, (2 Replies)
Discussion started by: rmkganesh
2 Replies
4. Shell Programming and Scripting
Hello,
I have big files which I wanna filter them based on first column.
first column should be one of these strings: chr2L || chr2R || chr3L || chr3R || chr4 || chrX
and something like chr2Lh or chrY or chrM3L is not accepted.
I used the following command:
awk '{ if ($1=="chr2L" ||... (5 Replies)
Discussion started by: @man
5 Replies
5. Shell Programming and Scripting
Hi,
Could somebody help me in understanding the following awk expression:
awk -v n="POINT" '/%/{print $0 "\n" n ;next}1' < file name
Thanks,
Arun (6 Replies)
Discussion started by: arun_maffy
6 Replies
6. Shell Programming and Scripting
I have the following simplified code that I am planning on putting into a larger shell script. I have been butchering it to try and make work amongst google searches and reading awk documentation.
amixer sset Master toggle | awk '{ if ( /^ Front Left/ { print $7 } == // ) print "MUTED" }'I... (2 Replies)
Discussion started by: jelloir
2 Replies
7. Shell Programming and Scripting
Hi,
I am trying to do evaluate one numerical string after substitution.
++++++++++++++++==
What I have = "7.04+2.3Xlog(0.72e-6X1.0e6)X1.9596"
What I need = evaluate 7.04+2.3*log(0.72e-6*1.0e6)*1.9596 = 5.55941
what I am doing;
echo "7.04+2.3Xlog(0.72e-6X1.0e6)X1.9596" | awk... (2 Replies)
Discussion started by: vivek_shm74
2 Replies
8. UNIX for Dummies Questions & Answers
Hi,
It can be used awk inside other Awk?. I need to get another text processing while other text process.
Thank you. (2 Replies)
Discussion started by: pepeli30
2 Replies
9. Shell Programming and Scripting
Hello world,
I was wondering if there is a nicer way to write the following code (in AWK):
awk '
FNR==NR&&$1~/^m$/{tok1=1}
FNR==NR&&$1~/^m10$/{tok1=1}
' my_file
In fact, it looks for m2, m4, m6, m8 and m10 and then return a positive flag. The problem is how to define 10 thanks... (3 Replies)
Discussion started by: jolecanard
3 Replies
10. Shell Programming and Scripting
I have a txt file like below:
testin.txt
AB
BC
CD
DE
I have the following awk script
BEGIN {flag1="N"}
/(AB)|(BC)|(CD)|(DE)/ {flag1="Y"}
END {print flag1}
>awk -f testin.awk testin.txt
Returns
Y (8 Replies)
Discussion started by: visakhcr
8 Replies