Sponsored Content
Full Discussion: Grouping and Calculating
Top Forums Shell Programming and Scripting Grouping and Calculating Post 302977395 by humaemo on Sunday 17th of July 2016 11:11:51 AM
Old 07-17-2016
Grouping and Calculating

Hi All,

I want to read the input file and store the output in the Output file. I pasted the sample Input and Output file below. Help me with this.

Input file
=================================
Code:
ITEM1	AAAAA	1
ITEM1	BBBBB	1
ITEM1	CCCCC	1
ITEM2	AAAAA	5
ITEM2	CCCCC	4

==================================

Output File
==================================
Code:
ITEM1	AAAAA	1
		BBBBB	1
		CCCCC	1
ITEM1	TOTAL	3

ITEM2	AAAAA	5
		CCCCC	4
TTEM2	TOTAL	9

		TOTAL	12

==================================

Last edited by Scrutinizer; 07-17-2016 at 12:24 PM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Regarding the user grouping

I am new to the unix server. My question is: i have 10 users a b c d e f g h i j Among the 10 5 users are (normal) user and remainging 5 users are (qad) users How can i sepearte this one? How can i give the dlc access rights? Please provide the clear cut idea. (0 Replies)
Discussion started by: kingganesh04
0 Replies

2. UNIX for Dummies Questions & Answers

grouping and sorting??

how would I write a command line that creates a new file named stuff.txt in the current working directory which contains the number of directories in the current working directory, followed by the number of empty files in the current working directory, followed by the name of the working directory? (3 Replies)
Discussion started by: jorogon0099
3 Replies

3. UNIX for Dummies Questions & Answers

Help with data grouping

Hi all, I have a set data as shown below, and i would like to eliminate the name that no children - boy and girl. What is the appropriate command can i use(other than grep)? Please assist... My input: name sex marital status children - boy children - girl ... (3 Replies)
Discussion started by: 793589
3 Replies

4. UNIX for Advanced & Expert Users

grouping lines

Hi all, I have input lines like below: A;100;Paris;City;10;0;0 A;100;Paris;City;0;10;0 A;100;Paris;City in Europe;0;0;20 B;101;London;City;20;0;0 B;101;London;City;0;20;0 B;101;London;City in Europe;0;0;40 I need to group the above lines to: A;100;Paris;City in Europe;10;10;20... (4 Replies)
Discussion started by: andy2000
4 Replies

5. Shell Programming and Scripting

Grouping each 2 lines

Whats a good way to group (by adding a new integer to the front of each line) pairs of lines, such that lines 1 & 2 are group 1, lines 3 & 4 are group 2, etc... ex input: A B C D etc... ex output: 1A 1B 2C 2D etc... (5 Replies)
Discussion started by: watingo
5 Replies

6. Shell Programming and Scripting

Calculating the epoch time from standard time using awk and calculating the duration

Hi All, I have the following time stamp data in 2 columns Date TimeStamp(also with milliseconds) 05/23/2012 08:30:11.250 05/23/2012 08:30:15.500 05/23/2012 08:31.15.500 . . etc From this data I need the following output. 0.00( row1-row1 in seconds) 04.25( row2-row1 in... (5 Replies)
Discussion started by: ks_reddy
5 Replies

7. Shell Programming and Scripting

Selective grouping

I have a text file in this format. Group: AAA Notes: IP : 11.11.11.11 #User xxxxxxxxx #Password aaaaaaaaaaaaaaaa Group: AAA Notes: IP : 11.11.11.22 #User yyyyyyyyyyyyy #Password bbbbbbbbbbbbb (8 Replies)
Discussion started by: anil510
8 Replies

8. UNIX for Dummies Questions & Answers

Grouping in grep

How do you do grouping in grep? Here's how I tried it at first: egrep 'qualit(y|ies)' /usr/share/dict/words -bash: syntax error near unexpected token `(' I'm using GNUgrep, and I found this on their site. grep regular expression syntax So I tried this: egrep 'qualit\(y\|ies\)'... (2 Replies)
Discussion started by: sudon't
2 Replies

9. Shell Programming and Scripting

Grouping

Hi all, I am using following command: perl program.pl input.txt output.txt CUTOFF 3 > groups_3.txt containing program.pl, two files (input.txt, output.txt) and getting output in groups_3.txt: But, I wish to have 30 files corresponding to each CUTOFF ranging from 0 to 30 using the same... (1 Reply)
Discussion started by: bioinfo
1 Replies

10. Shell Programming and Scripting

Name grouping

awk 'FNR==NR {a; next} $NF in a' genes.txt refseq_exons.txt > output.txt I can not figure out how to group the same name in $4 together. Basically, all the SKI together in separate rows and all the TGFB2. Thank you :). chr1 2160133 2161174 SKI chr1 218518675 218520389 TGFB2... (1 Reply)
Discussion started by: cmccabe
1 Replies
g_disre(1)					 GROMACS suite, VERSION 4.5.4-dev-20110404-bc5695c					g_disre(1)

NAME
g_disre - analyzes distance restraints VERSION 4.5.4-dev-20110404-bc5695c SYNOPSIS
g_disre -s topol.tpr -f traj.xtc -ds drsum.xvg -da draver.xvg -dn drnum.xvg -dm drmax.xvg -dr restr.xvg -l disres.log -n viol.ndx -q viol.pdb -c clust.ndx -x matrix.xpm -[no]h -[no]version -nice int -b time -e time -dt time -[no]w -xvg enum -ntop int -maxdr real -nlevels int -[no]third DESCRIPTION
g_disre computes violations of distance restraints. If necessary, all protons can be added to a protein molecule using the g_protonate program. The program always computes the instantaneous violations rather than time-averaged, because this analysis is done from a trajectory file afterwards it does not make sense to use time averaging. However, the time averaged values per restraint are given in the log file. An index file may be used to select specific restraints for printing. When the optional -q flag is given a .pdb file coloured by the amount of average violations. When the -c option is given, an index file will be read containing the frames in your trajectory corresponding to the clusters (defined in another manner) that you want to analyze. For these clusters the program will compute average violations using the third power averaging algorithm and print them in the log file. FILES
-s topol.tpr Input Run input file: tpr tpb tpa -f traj.xtc Input Trajectory: xtc trr trj gro g96 pdb cpt -ds drsum.xvg Output xvgr/xmgr file -da draver.xvg Output xvgr/xmgr file -dn drnum.xvg Output xvgr/xmgr file -dm drmax.xvg Output xvgr/xmgr file -dr restr.xvg Output xvgr/xmgr file -l disres.log Output Log file -n viol.ndx Input, Opt. Index file -q viol.pdb Output, Opt. Protein data bank file -c clust.ndx Input, Opt. Index file -x matrix.xpm Output, Opt. X PixMap compatible matrix file OTHER OPTIONS
-[no]hno Print help info and quit -[no]versionno Print version info and quit -nice int 19 Set the nicelevel -b time 0 First frame (ps) to read from trajectory -e time 0 Last frame (ps) to read from trajectory -dt time 0 Only use frame when t MOD dt = first time (ps) -[no]wno View output .xvg, .xpm, .eps and .pdb files -xvg enum xmgrace xvg plot formatting: xmgrace, xmgr or none -ntop int 0 Number of large violations that are stored in the log file every step -maxdr real 0 Maximum distance violation in matrix output. If less than or equal to 0 the maximum will be determined by the data. -nlevels int 20 Number of levels in the matrix output -[no]thirdyes Use inverse third power averaging or linear for matrix output SEE ALSO
gromacs(7) More information about GROMACS is available at <http://www.gromacs.org/>. Mon 4 Apr 2011 g_disre(1)
All times are GMT -4. The time now is 07:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy