09-22-2011
Which awk version (which operating system)?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, I have used the following code to sort two sets of data:
awk '{printf "%10s %s\n",$1,$2}'
The first column is text and the second involves numbers. I was just wondering how i would go about sorting the second number so that they ascend from the top?
Thanks for any help (4 Replies)
Discussion started by: Jaken
4 Replies
2. Shell Programming and Scripting
i have following file have following type of data
1~%%~fcashfafh~%%~9797
can i sort(numeric) the file on first field and then on last feild using awk (3 Replies)
Discussion started by: mahabunta
3 Replies
3. Shell Programming and Scripting
Little-bit of awk experience, need some of the expert help on here. Browsed around here, got a little further, but I am still missing some pieces. Can you help me fill-in my missing awk cells?
Sample data file (leaving out ","'s):
Column 1 Column 2 Column 3 Column 4 ... (10 Replies)
Discussion started by: boolean2222
10 Replies
4. Shell Programming and Scripting
dn: uid=peter@exmaple.com,ou=example-com,ou=mail,dc=example,dc=to
cn: Peter
sn: Norton
displayName: Peter Norton
dn: uid=ras@exmaple.com,ou=example-com,ou=mail,dc=example,dc=to
cn: Ras
sn: Kam
displayName: Ras Kam
i have a text file with 300 entries with multiple ldap entries... (5 Replies)
Discussion started by: learnbash
5 Replies
5. Shell Programming and Scripting
I have an array with five columns and i want to write it to a file.
Before writing it i must sort it using the field in the fifth column.
_________________________________________
|field 1|field 2|field 3|field 4|field 5|
| | | | | |
| | | |... (6 Replies)
Discussion started by: beatblaster666
6 Replies
6. Shell Programming and Scripting
Hi all,
Can any one help whether we can able to sort a record with delimiter
plz ? (3 Replies)
Discussion started by: thelakbe
3 Replies
7. Shell Programming and Scripting
Hello,
I have a file as follows:
BTA Pos KLD
4 79.7011 5.7711028907
4 79.6231 5.7083918219
5 20.9112 4.5559494707
5 58.0002 3.4423546273
6 38.2569 4.7108176788
6 18.3889 7.3631759258 (1 Reply)
Discussion started by: Homa
1 Replies
8. Shell Programming and Scripting
Hi! all
can any one tell me how to compare current record of column with next and previous record in awk without using array
my case is like this
input.txt
0 32
1 26
2 27
3 34
4 26
5 25
6 24
9 23
0 32
1 28
2 15
3 26
4 24 (7 Replies)
Discussion started by: Dona Clara
7 Replies
9. Shell Programming and Scripting
Dear Team,
Can any body help me out to get the filed position of the records post sorting using AWK programming.
Thanks in advance
Example Input:
StudentID col-1 col-2 col-3 col-4
1234 14 10 12 13
1235 10 11 12 13
1236 13 12 11 10 ... (3 Replies)
Discussion started by: Srinivasa Reddy
3 Replies
10. Shell Programming and Scripting
Hi Everyone,
I have below record set. File is fixed widht file
101newjersyus 20150110
101nboston us 20150103
102boston us 20140106
102boston us 20140103
I need to group record based on first 3 letters in our case(101 and 102)
and sort last 8 digit in ascending order and print only... (4 Replies)
Discussion started by: patricjemmy6
4 Replies
LEARN ABOUT MOJAVE
sw_vers
SW_VERS(1) BSD General Commands Manual SW_VERS(1)
NAME
sw_vers -- print Mac OS X operating system version information
SYNOPSIS
sw_vers
sw_vers -productName
sw_vers -productVersion
sw_vers -buildVersion
DESCRIPTION
sw_vers prints version information about the Mac OS X or Mac OS X Server operating system running on the local machine.
When executed with no options sw_vers prints a short list of version properties:
% sw_vers
ProductName: Mac OS X
ProductVersion: 10.3
BuildVersion: 7A100
The ProductName property provides the name of the operating system release (typically either "Mac OS X" or "Mac OS X Server"). The
ProductVersion property defines the version of the operating system release (for example, "10.2.4" or "10.3"). The BuildVersion property
provides the specific revision of the operating system as generated by the Mac OS X build system.
OPTIONS
The output of sw_vers can be refined by the following options.
-productName Print just the value of the ProductName property.
-productVersion Print just the value of the ProductVersion property.
-buildVersion Print just the value of the BuildVersion property.
EXAMPLES
% sw_vers -productName
Mac OS X
% sw_vers -productVersion
10.3
% sw_vers -buildVersion
7A100
FILES
/System/Library/CoreServices/SystemVersion.plist
/System/Library/CoreServices/ServerVersion.plist
Mac OS X March 10, 2003 Mac OS X