11-15-2012
What is the way to get a total count of students and with highest marks from a file?
I have different things that I was trying to do but am kind of struggling with this since I'm a Linux noob. I have a files with student names ,marks,year school the . What is the most efficient way to get a total count of students and student with highest marks
Initially I tried to get a count and pipe it out, but was at a loss as to how to get a count of the students only enrolled in one class, but this is where I am at now.
School.txt
name,marks,year,school
abhi,95,2001,pda
ram,96,2002,nv
raghu,97,2003,noble
prasanna,85,2004,sbr
pras,85,2004,sbr
ravi,86,2006,sbr
sanju,75,2009,sbr
abhilash,60,2000,sbr
prashant,99,2010,hgus
geeta,97,2011,klms
1. print total number of schools
cut -d"," -f4 ram.txt |sort |uniq | grep -v "School" | wc -l
2. print the senior most student name and junior most student name
9 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi All,
I'm developing a FTP script as below:
ftp -v -n <IP_ADDRESS> << EOF
user avery jSqaqUU2
lcd /directory/folder/
ascii
prompt
mget *
bye
EOF
I would like to enhance the script to count the total file downloaded. For example, once the script run i want the message "Total <n>... (1 Reply)
Discussion started by: cas553
1 Replies
2. Shell Programming and Scripting
Hi Everybody,
I have the following example file...
199|TST-GURGAON|GURGAON|1
199|TST-GURGAON|GURGAON|1
199|TST-GURGAON|GURGAON|1
199|TST-GURGAON|GURGAON|1
199|TST-GURGAON|GURGAON|1
199|TST-GURGAON|GURGAON|1
199|TST-GURGAON|GURGAON|1
199|TST-GURGAON|GURGAON|1
199|TST-GURGAON|GURGAON|1... (8 Replies)
Discussion started by: sraj142
8 Replies
3. Shell Programming and Scripting
I have the following string:
31-01-2012, 09:42:37;OK;94727132638;"Mozilla/5.0 (Linux; U; Android 2.2.1)";3G;WAP;I need a script which is counting the occurrence of semicolons ( ; ) but exclude the ones from the quotation marks.
In the string given as example there are 8 semicolons but the script... (3 Replies)
Discussion started by: calinlicj
3 Replies
4. UNIX for Dummies Questions & Answers
How to find count total number of pattern in a file …
File contains : a.txt
-------------
aaa bbb nnn
ccc aaa bbb
aaa ddd aaa
aaa aaa aaa
grep -c aaa a.txt
Op: 4 ( But my requirement is should count the total no of patterns as 7 ) (4 Replies)
Discussion started by: Jitten
4 Replies
5. UNIX for Dummies Questions & Answers
Hi All,
When i give ls -ltr i get 'total 10' like this along with files long listing. is there any option in ls command to remove this line or do we need use head -1 command only.
$ls -ltr
total 45
-rw-r--r-- 1 abc g1 0 Jul 17 07:20 0
-rw-r--r-- 1 abc g1 744 May 9 12:10 a
-rw-r--r--... (1 Reply)
Discussion started by: HemaV
1 Replies
6. Shell Programming and Scripting
I have list of file names in filename.txt
below is file format
>>File1
_________________________
01~12345~Y~YES~aaaaa~can
02~23456~N~NO~bbbbb~can
.
.
.
99~23__________________________
Need to find total count from each file depending on specific string and add them to have total count... (17 Replies)
Discussion started by: santoshdrkr
17 Replies
7. Shell Programming and Scripting
Hi all,
I have found another post threads talking about count duplicate lines, but I am interested in obtain the total number of duplicates. For example:
#file.txt
a1
a2
a1
a3
a1
a2
a4
a5
#out
3 (lines are duplicates)
Thank you! (12 Replies)
Discussion started by: mikloz
12 Replies
8. UNIX for Dummies Questions & Answers
Hi all, I have a file that contains characters. How do I get total of spesific character from that file and save the count to a variable for doing for calculation.
data.txt
1
2
2
2
2
3
3
4
5
6
7
8
5
4
3
4 (5 Replies)
Discussion started by: weslyarfan
5 Replies
9. Shell Programming and Scripting
Hi All ,
We need one help on the below requirement.We have multiple pipe delimited .txt file(around 100 .txt files) present on one directory.We need the total record count of all the files present in that directory without header.File format as below :
... (8 Replies)
Discussion started by: STCET22
8 Replies
LEARN ABOUT DEBIAN
amc-analyse
AMC-ANALYSE(1) Auto Multiple Choice AMC-ANALYSE(1)
NAME
AMC-analyse - automatic data capture from scans for AMC multiple choice exams.
SYNOPSIS
auto-multiple-choice analyse --projet project-dir [--seuil-coche threshold] [--tol-marque tol] [--list-fichiers files-list.txt |
scan-files...]
DESCRIPTION
The AMC-analyse.pl command performs automatic data capture from scans of completed answer sheets of an AMC multiple choice questionnaire.
Before calling AMC-analyse.pl, AMC-prepare(1) should have been called to make working documents (--mode s) and the layout should have been
processed with AMC-meptex(1).
--data data-dir
gives the directory where data files are (see for example AMC-meptex(1)). Defaults to project-dir/data.
--cr project-cr-dir
gives a directory where to create image reports of the data capture (zooms on the boxes in a zooms sub-directory, name filed extraction
as a name-*.jpg file, and layout report as a page-*.jpg file).
--projet project-dir
When using this option, if --cr is not used, project-cr-dir will be set to project-dir/cr.
Giving the names of the scan files to process can be done in two ways:
o these names can be given as arguments,
o these names can be written to a plain file (one filename per line), using the --list-fichiers files-list.txt to give the name of this
file.
Some parameters for data capture may be set using the following options:
--prop proportion
sets the proportion of each box that will be measured to decide if the box is ticked or not. Default value is 0.8.
--seuil-coche threshold
When deciding whether a box is checked or not, AMC-analyse.pl compares the black ratio (number of black pixels over total number of
pixels) to threshold. If the black ratio is greater then threshold, the box is declared to be checked. Standard values can be 0.15 in
the standard layout, or 0.5 for separate answer sheet layout (in this last case, letters are drawn in the boxes, and the students are
told to fill the boxes entirely). The black ratio is written in the data capture reports, so that this threshold value can be refined
later without calling AMC-analyse.pl again.
--bw-threshold threshold
This parameter is used when converting the grayscale scan file to black and white. To get more black pixels, use a greater value. To
get more white pixels, use a smaller value. The threshold must be between 0 and 1. The default value is 0.6.
--ignore-red
With this option, only red channel will be used from color scans. This way, all that is written in red will be ignored in the scan.
This can be useful when the boxes are printed in red.
--tol-marque tol
defines the tolerance when detecting the four marks in the scans corners. These marks are detected looking for black connected
components which dimensions are closed to the target dimension target (exact dimensions of the marks if printing/scanning process where
perfectly acurate). If tol is a real number, accepted dimensions are those between (1-tol)*target and (1+tol)*target. If tol is
"tinf,tsup" (where tinf and tsup are real numbers), accepted dimensions are those between (1-tinf)*target and (1+tsup)*target. A
standard value is 0.2.
--multiple
This option is to be used when the scans are photocopies from some subjects (different students can have the same subject). In thie
case, copy numbers are allocated to students so that their answer sheets, with the same subject number, can be differenciated.
--pre-allocate copy_id
This option can be used in conjonction with --multiple. The copy numbers used for the scans will start from copy_id, in the same order
than the scans given as arguments.
--debug file.log
gives a file to fill with debugging information.
AUTHORS
Alexis Bienvenue <paamc@passoire.fr>
Main author
Jean Berard
Translation from French
Georges Khaznadar
Translation from French
COPYRIGHT
Copyright (C) 2008-2012 Alexis Bienvenue
This document can be used according to the terms of the GNU General Public License, version 2 or later.
Auto Multiple Choice 1.1.1 06/19/2012 AMC-ANALYSE(1)