Sponsored Content
Full Discussion: repetition calculation
Top Forums Shell Programming and Scripting repetition calculation Post 302602655 by balajesuri on Tuesday 28th of February 2012 01:56:59 AM
Old 02-28-2012
Lot of pipes:
Code:
sed -n '2,$p' mylist | awk '{print $1}' | sort | uniq -c | awk '{print $2,$1}' | sort -nrk2

Perl.
Code:
perl -ane '($.==1)&& next; $x{$F[0]}++; END{for(keys %x){print "$_ $x{$_}\n"}}' mylist | sort -nrk2


Last edited by balajesuri; 02-28-2012 at 03:02 AM..
This User Gave Thanks to balajesuri For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Random numbers without repetition

Is anyone know some scripts to generate random number without repetition using bash; for example generate 10 different random numbers. Thanks (8 Replies)
Discussion started by: asal_email
8 Replies

2. UNIX for Advanced & Expert Users

Looping/Repetition in Batch files

Hi All, I'm just new to UNIX, does anyone know how to create a batch file in UNIX that does the following routines: 1.) process multiple files in a directory in DOS, I set my sample input file as: set INPUTFILE=%1 in UNIX>> ???? 2.) every file to be processed by executing a program... (1 Reply)
Discussion started by: kimpot7268
1 Replies

3. Shell Programming and Scripting

Looping/Repetition in Batch files

Hi All, I'm just new to UNIX, does anyone know how to create a batch file in UNIX that does the following routines: 1.) process multiple files in a directory in DOS, I set my sample input file as: set INPUTFILE=%1 in UNIX>> ???? 2.) every file to be processed by executing a program... (2 Replies)
Discussion started by: kimpot7268
2 Replies

4. Shell Programming and Scripting

Count the repetition of a Field in File

Hi, Thanks for keeping such a help-full platform active and live always. I am new to this forum and to unix also. Want to know how to count the repetition of a field in a file. Anything of awk, sed, perl, shell script, solution are welcomed. Input File------------------ abc,12345 pqr,51223... (10 Replies)
Discussion started by: indian.ace
10 Replies

5. Programming

Words combinations without repetition

How can I get all combinations of 5 words from 10 words. For example I have 3 words and I want to get all combinations of 2 words. "A", "B", "C" it would like AB, BC, AC. Maybe you know some usefull code or example. Thanx a lot. P.S. Sorry if I'm not right enough cause I don't know English... (2 Replies)
Discussion started by: romeo5577
2 Replies

6. UNIX for Advanced & Expert Users

Counting the number of repetition of a pattern

the o/p of a command is -bash-2.05b# grep -o a * cc:a dd:a a dd:a office:a a a a a a a a a a a a a a (2 Replies)
Discussion started by: an2up
2 Replies

7. Shell Programming and Scripting

Help with awk for selecting lines in a file avoiding repetition

Hello, I am using Awk in UBUNTU 12.04. I have a file as following with 48,432,354 lines and 4 fields. The file has this structure (There are repetitions of the first column in several lines) AB_14 S54 A G AB_14 S55 A A AB_14 S56 G G GO_15 S45 T A GO_15 S46 A A PT_16 S33 C C PT_16 ... (4 Replies)
Discussion started by: Homa
4 Replies

8. UNIX for Advanced & Expert Users

UNIX script for making random numbers without repetition

Hello, I have a column which have 7200 numbers and I am deciding to pick up 1440 numbers randomly without any reputation? Could any one let me know which script in unix will be work for my case? Regards Sajjad (17 Replies)
Discussion started by: sajmar
17 Replies

9. UNIX for Beginners Questions & Answers

Repetition in a particular interval

Suppose I have a word which is repeating in a string continuously. I have a set of intervals. Then how do I find the number occurrences of that word in those intervals and their location of occurrences. For example - Suppose there is a huge string anfie.......sirn of 10000 letters. Now the word... (2 Replies)
Discussion started by: ANKIT ROY
2 Replies

10. Windows & DOS: Issues & Discussions

Adding same value to variables in does each repetition of command

So, I have this command: mkdir rolled for %%x in (*gif) do convert %%x -roll +2+6 %%x|move %%x rolled I'd like to have the +2 and +6 accumulate here. In each new gif tackled, it should increase by the amount: +2 (for x) and +6 (for y) Is this possible? I'm on Windows, DOS. (0 Replies)
Discussion started by: pasc
0 Replies
RPWS(1) 						User Contributed Perl Documentation						   RPWS(1)

NAME
rpws - Implements multiple workspaces in ratpoison SYNOPSIS
rpws init n [-k] [-a] - setup rpws with n workspaces. -a sets up command aliases; -k sets up key bindings and aliases. rpws help - this documentation rpws n - switch to this workspace DESCRIPTION
B<rpws> implements multiple workspaces in ratpoison by making calls to fdump, freestore. It was adapted from rpws which comes with ratpoison in the contrib directory. USAGE
Add the following line in ~/.ratpoisonrc exec /path/to/rpws init 6 -k This creates 6 aliases rpws1, rpws2, etc. It also binds the keys M-F1, M-F2, etc to each rpwsN alias. Moreover, rpwsn (Next) and rpwsp (Prev) are created, and C-M-{Right,Left} are bound to rpws{n,p}. FILES
rpws requires use of a lockfile. It defaults to using /tmp/rpws.<UID>.lock but this can be changed by setting the environment variable RPWS_LOCKFILE to your desired lockfile. AUTHOR
Mike O'Connor <stew@vireo.org> COPYRIGHT
Copyright (c) 2005 Mike O'Connor All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. perl v5.14.2 2009-07-07 RPWS(1)
All times are GMT -4. The time now is 10:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy