02-13-2009
parsing a file and manipulating the contents
Hi
I have a text file as follows
BOB
14/14
TOM
94/94
SAM
3/3
CRIS
13/13
TOM
6/6
CRIS
27/27
SAM
2/2
JACK
25/25
CRIS
2/2
SAM
1/1
DAN
96/96
JACK
106/106
BOB
279/279
I want to find out the results as follows
BOB PASS
TOM PASS
SAM PASS
CRIS PASS
SAM PASS
JACK PASS
DAN PASS
if the text file contains as follows
BOB
11/14
TOM
94/94
SAM
3/3
CRIS
13/13
TOM
6/6
CRIS
21/27
SAM
2/2
JACK
25/25
CRIS
2/2
SAM
1/1
DAN
90/96
JACK
106/106
BOB
279/279
then the output should be
BOB FAIL
TOM PASS
SAM PASS
CRIS FAIL
SAM PASS
JACK PASS
DAN FAIL
The particular person should be marked as fail, when he does not gets full marks in any of the exams.
the output should not be redirected to file but should be displayed to a standard output.
Please do help me how to acheive this?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Suppose I have a file which has either the contents
CALLED on <date & time>
RUNNING on <date & time>or
CALLED on <date & time>
RUNNING on <date & time>
SHUTTING_DOWN on <date & time>
DOWN on <date & time>
I don't care about the <date & time> part... I just need to know if the last line in... (3 Replies)
Discussion started by: orno
3 Replies
2. Shell Programming and Scripting
Hi,
I need some help in extracting the Exception block between the lines
21 Feb 01:18:54:146 ERROR com.orbits.frameworks.integrationframework.ValidationException - Caught exception in validateRequest() (PID=565584)
and
21 Feb 01:18:55:149 INFO ... (0 Replies)
Discussion started by: Alecs
0 Replies
3. Shell Programming and Scripting
hi, unix gurus.
i am trying to read a file that has records in this format...
x<group_id>:::<member1a>,<member1b>,<member1c>
x<group_id>:::<member2a>,<member2b>,<member2c>
... and to put it in this format:
<member1a>
<member1b>
<member1c>
<member2a>
<member2b>
<member2c>
... (3 Replies)
Discussion started by: ankimo
3 Replies
4. Shell Programming and Scripting
Hey guys,
I have this file generated by me... i want to create some HTML output from it.
The problem is that i am really confused about how do I go about reading the file.
The file is in the following format:
TID1 Name1 ATime=xx AResult=yyy AExpected=yyy BTime=xx BResult=yyy... (8 Replies)
Discussion started by: umar.shaikh
8 Replies
5. Shell Programming and Scripting
Hello everyone, my first post here, please feel free to inform me if my question can be better formatted so my future posts may be more clear.
I have a large text file which I need parsed in one specific way, I have done the rest of the processing, I am simply lacking the last aspect of such.
... (8 Replies)
Discussion started by: ryanfx
8 Replies
6. UNIX for Dummies Questions & Answers
Give shell script....which takes two file names as input and compares the contents, is both are same delete second file's contents.....
I try with "diff"...... but confusion how to use "diff" with if ---else
Thanking you (5 Replies)
Discussion started by: krishnampkkm
5 Replies
7. Shell Programming and Scripting
Hi,
I want to delete the contents of a file which are matching with contents of other file in shell scripting.
Ex.
file1
sheel,sumit,1,2,3,4,5,6,7,8
sumit,rana,2,3,4,5,6,7,8,9
grade,pass,2,3,4,5,6,232,1,1
name,sur,33,1,4,12,3,5,6,8
sheel,pass,2,3,4,5,6,232,1,1
File2... (3 Replies)
Discussion started by: ranasheel2000
3 Replies
8. Shell Programming and Scripting
Hi
I'm just messing around with bash and trying to learn it because I have a course next semester dealing with OS design where we need to know how to use SSH client and either bash or ksh. I've never done shell scripting before.
I just started today and I was wondering how parsing files... (1 Reply)
Discussion started by: mehungry
1 Replies
9. Shell Programming and Scripting
Hi,
I am facing issue while reading data from a file in UNIX. my requirement is to compare two files and for the text pattern matching in the 1st file, replace the contents in second file by the contents of first file from start to the end and write the contents to thrid file.
i am able to... (2 Replies)
Discussion started by: seeki
2 Replies
10. Shell Programming and Scripting
Hi one of the output of the command is as below
# sed -n "/CCM-ResourceHealthCheck:/,/---------/{/CCM-ResourceHealthCheck:/d;/---------/d;p;}" Automation.OutputZ$zoneCounter | sed 's/$/<br>/'
Resource List : <br>
*************************** 1. row ***************************<br>
... (2 Replies)
Discussion started by: vivek d r
2 Replies
LEARN ABOUT DEBIAN
qjackctl
QJACKCTL(1) General Commands Manual QJACKCTL(1)
NAME
qjackctl - User interface for controlling JACK (Jack Audio Connection Kit)
SYNOPSIS
qjackctl [options]
DESCRIPTION
This manual page documents briefly the qjackctl command. This manual page was written for the Debian distribution because the original
program does not have a manual page.
qjackctl is used for controlling the Jack Audio Connection Kit (JACK) and as a patchbay for ALSA MIDI devices. Qjackctl also has support
for the JACK transport control protocol, so you can use it to start and stop the JACK transport. Once you start qjackctl, you get presented
with a single GUI window, the buttons are self-explanatory and have tooltips.
OPTIONS
This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included
below. For a complete description, see the Info files.
-s, --start
Start JACK audio server immediately
-p, --preset=[label]
Set default settings preset name
-a, --active-patchbay=[path]
Set active patchbay definition file
-n, --server-name=[label]
Set default JACK audio server name
-h, --help
Show help about command line options
-v, --version
Show version information.
SEE ALSO
jackd(1).
FILES
Settings for the JACK system are stored in ~/.config/rncbc.org/QjackCtl.conf and optionally in ~/.jackdrc.
AUTHOR
This manual page was written by Guenter Geiger <geiger@debian.org>, for the Debian project (but may be used by others).
January 11, 2010 QJACKCTL(1)