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 want to create a conditional expression string and pass in an awk script. My script is as below...
comm="\$3 == "hello""
awk -F "^T" -v command="${comm}" ' {
if ( command ) { print "hye" }
}' testBut the statement "if ( command )" always evaluates to true which is not... (5 Replies)
Discussion started by: Saikat123
5 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
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
5. UNIX for Dummies Questions & Answers
Cannot understand what the "&" in the sub expression is supposed to do.
{sub(/^/,"&" s)} (3 Replies)
Discussion started by: kristinu
3 Replies
6. Shell Programming and Scripting
Hello,
I have thousand of messages (HL7), I want to use awk to extract only the ones that have a particular value in pv1.18
Each record in the file is the whole HL7 message, ie. when I print $0 I get the whole message MSH EVN PID etc. ,there is an x0d between the segments.
I would like to use a... (3 Replies)
Discussion started by: gio001
3 Replies
7. Programming
Hi,
I am trying to write a regular expression in perl to check if the string end's with "numbers-numbers" or "-numbers".
I experimented something like m/\d*-\d*$/ , but this is not solving my problem.
Can anyone help me in writing this expression?
Well spelled titles and proper use of code... (2 Replies)
Discussion started by: successlin
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. UNIX for Dummies Questions & Answers
I can print a line with an expression using this:
awk '/regex/'
I can print the line immediately before an expression using this:
awk '/regex/{print x};{x=$0}'
How do I print the line immediately before and then the line with the expression? (2 Replies)
Discussion started by: nickg
2 Replies
10. Shell Programming and Scripting
How to compare the file name for "zip" or "ZIP" extension.
I can put one more || condition to check the upper case in the below:
if ]; then
Is there any better way to compare using regular expressions.
Thx in advance. (4 Replies)
Discussion started by: devs
4 Replies