Sponsored Content
Top Forums UNIX for Dummies Questions & Answers AWK - Hard to understand for me Post 302608067 by itkamaraj on Friday 16th of March 2012 04:44:36 AM
Old 03-16-2012
-F\| --> Filed seperator is |

!/#/ --> process the lines which is not having #

print $4 --> print the 4th filed ( seperated by | )

sort -u --> print only unique values from the awk command output
This User Gave Thanks to itkamaraj For This Post:
 

10 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

The best partitioning schem for a 250GB Sata hard drive & a 75GB SCSI hard drive

Hi I have 2 75GB SCSI hard drives and 2 250GB SATA hard drives which are using RAID Level 1 respectively. I wana have both FTP and Apache installed on them as services. I'm wondering what's the best partitioning schem? I wana use FC3 as my OS, so, I thought I can use the 75GB hard drive as the /... (0 Replies)
Discussion started by: sirbijan
0 Replies

2. UNIX for Dummies Questions & Answers

Unable to understand associative nature of awk arrays

About associative nature of awk arrays i'm still confused, not able to understand yet how array element can be accessed based on a string, I got one example at gawk manual to illustrate associative nature of awk arrays, it goes here: Codeawk ' # Print list of word frequencies { for (i = 1;... (3 Replies)
Discussion started by: nervous
3 Replies

3. UNIX for Dummies Questions & Answers

unable to understand a awk code

i am not able to understand the following code for awk: $awk -F"|" '{ kount++} >END { for (desig in kount) > print desig,kount }' emp.list the input file i.e. emp.list is :: 3432| p.k.agrwal |g.m |sales 4566|g.l.sharma |director|production 3433|r shah | g.m | production... (1 Reply)
Discussion started by: streetfi8er
1 Replies

4. Shell Programming and Scripting

Don't understand how RS functions in awk

I learn using RS in awk to extract portion of file in this forum which is wonderful solution to the problem. However, I don't understand how exactly it operates. I don't quite understand the mechanism behind how searching for /DATA2/ can result in extracting the whole section under "DATA2" ... (3 Replies)
Discussion started by: joe228
3 Replies

5. Shell Programming and Scripting

Need help to understand Awk code.

Hi Guys, Can someone please explain this code to me. I could figure out it's adding and comparing two fields but I am not sure which ones. sort -t"|" -k3.1 /tmp/mpcashqc.xtr| awk -F"|" '{CHECKAMT+=$3;BATCHTOT=$4;\ items++}END{for(i in CHECKAMT) if (CHECKAMT!=BATCHTOT)... (6 Replies)
Discussion started by: nua7
6 Replies

6. Shell Programming and Scripting

Don't understand AWK asort behaviour

Hello, I have the following script : BEGIN { print "1 ***"; split("abc",T,""); T="e"; T="z"; T="y"; for (i in T) printf("%i:%s ",i,T); print ""; for (i=1; i<=length(T); i++) printf(T); print "" print "2 ***"; asort(T,U); for (i in U) printf("%i:%s ",i,U); ... (3 Replies)
Discussion started by: jgilot
3 Replies

7. Shell Programming and Scripting

awk doesn't understand 'read' statement!!!

While working on awk programming, i found that it doesn't understand 'read' statement. Then what's the use of 'continue' and 'break' statement in awk. For ex: awk '{k=1; while (k<10) {print $0; k++}}' emp.lst Now, please say if I want to put the logic that after priting 1 line, it will ask for... (13 Replies)
Discussion started by: ravisingh
13 Replies

8. UNIX for Dummies Questions & Answers

Unable to understand awk script.

Hi below is the samll awk script which i am not able to understand properly. here a bit confusion in 2nd line for me 1. why *\ is not used before . in second line as it was used in first line *\$*\. */ 2. why always \ is used in every first line 3. is there any specific meaning... (9 Replies)
Discussion started by: scriptor
9 Replies

9. Shell Programming and Scripting

(hard one) awk, copy matching 2 col & 10-12 rows, is it possible?

Hey guys, my first post here. I'm trying to use awk to copy all matching paragraphs from one file The file looks like this : Test Case Number 990990003099 Card Type CCCC Transaction Type Sale Entry Mode Keyed Account Number 4099562299219923 Transaction Amount 78.88 Description lorem... (2 Replies)
Discussion started by: awkawed
2 Replies

10. UNIX for Beginners Questions & Answers

Help understand awk command

Help understand awk command This command converts the column values to rows. Command: awk -s1=" " '{S=S?S OFS s1 $0 s1:s1 $0 s1} END{print S}' OFS=, Input_file Example: 1 2 3 is converted to: 1, 2, 3 Can anyone please help me understand this command? Please use code tags when... (1 Reply)
Discussion started by: mohan44
1 Replies
NMBSTATUS(1)						User Contributed Perl Documentation					      NMBSTATUS(1)

NAME
nmbstatus - Lists NMB node status of a UDP network SYNOPSIS
nmbstatus [options] Options: --workgroup --pdc --bdc --lmb --dmb --members --quiet --allworkgroups --winsserver --print0 --debug --help --man GENERAL OPTIONS
--help Print a brief help message and exits.Prints a help message. --man Print the manual page and exit. --print0 Use '' instead of a tab stop as seperator between the output. --debug Use an debuglevel. No debuglevel available yet. GENERAL ARGUMENTS
--workgroup Perform all actions on this workgroup name. If no workgroup is set the information off all available groups is shown. --pdc If not called in conjunction with --quiet print a line starting with the acronym PDC followed by the seperator and the netbios name of the PDC if one is available. If not print nothing and return with 1. --bdc If not called in conjunction with --quiet print a line starting with the acronym BDC followed by the seperator and the netbios name of the BDC if one is available. If not print nothing and return with 1. --dmb If not called in conjunction with --quiet print a line starting with the acronym DMB followed by the seperator and the netbios name of the DMB if one is available. If not print nothing and return with 1. --lmb If not called in conjunction with --quiet print a line starting with the acronym LMB followed by the seperator and the netbios name of the LMB if one is available. If not print nothing and return with 1. --members If not called in conjunction with --quiet print a line starting with the word MEMBERS followed by the seperator and the netbios names of the workgroup members. If not print nothing and return with 1. --quiet Don't print any information. Just return with 0 if a type - pdc, lmb, dmb, or members was found. Else return 1. --allworkgroups List all available workgroups. --winsserver Use this WINS server to gather the information. DESCRIPTION
nmbstatus will detect workgroups, PDCs, BDCs, DMBs, LMBs, and Members of workgroups in your network. If more than one type is specizied but only one result found, nmbstatus nevertheless returns 0. AUTHOR
Lars Mueller <lmuelle@suse.de> If you find any errors in the code please let me know. COPYRIGHT
Copyright (c) 2003-2004 SuSE Linux AG. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. POD ERRORS
Hey! The above document had some coding errors, which are explained below: Around line 339: You forgot a '=back' before '=head1' Around line 341: '=item' outside of any '=over' perl v5.12.1 2009-01-02 NMBSTATUS(1)
All times are GMT -4. The time now is 07:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy