11-15-2001
cant find command that returns blank line
This is my list of sed commands: can anyone tell me where im going wrong. The script works on a file called data which contains 6 student id's and there answers for 6 questions.
!/bin/sh
sed -e 's/*//g' \ #replace * with nothing
-e s/ /X/g' \ #replacing empty space with X
-e 's/960...../& \ #student No.
/g' \
-e 's/[0-9][0-9][TFX][TFX][TFX][TFX]/&\
/g \
e 's/[TFX]/ &/g' \
When it outputs the file there is an extra line with nothing on it. How do i get rid of the extra line??
e.g.
52000012
01 8
02 4
03 8
04 2
05 0
06 6
52000013
01 8
02 4
03 10
Any suggestions would be greatfully recieved.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Please can you someone help me out to eliminate the problem. Here, it correctly prints the myFilenameCount but returns the first value of array myFilenamePatterns as blank.
Thanks,
Sudhakar
i=0
get_config_values_from_mediation_cfg "FILENAME_PATTERN"|while read myFilenamePatterns
do... (1 Reply)
Discussion started by: Sudhakar333
1 Replies
2. UNIX for Dummies Questions & Answers
Hi guys.
I am trying, to move files found with the find command...
Script runs fine, until it reaches a file that contains spaces...
Here is what i wrote up quickly.
ROOTDIR=/apps/data
SEARCH=$(find /data/HDTMPRestore/home/tmq/ -type f -print | grep Mods/Input/bck | cut -c19-)
for i... (1 Reply)
Discussion started by: Stephan
1 Replies
3. Shell Programming and Scripting
Hello,
I actually have two issues. First, here is the file the way it is now.
someword someword:1
new-word new-word abcd
someword someword:10
new-word new-word abcd
thisis whatIneed:3
someword someword:5
new-word new-word abcd
I need to get the line before the 2... (6 Replies)
Discussion started by: ddrew78
6 Replies
4. Shell Programming and Scripting
Hi,
I would like to know how to solve one of my problems using expert unix commands.
I have a file with occasional blank lines;
for example;
dertu
frthu
fghtu
frtty
frtgy
frgtui
frgtu
ghrye
frhutp
frjuf
I need to edit the file so that the file looks like this; (10 Replies)
Discussion started by: Lucky Ali
10 Replies
5. Shell Programming and Scripting
Hi
Is it possible to do the following in a single command
/usr/xpg4/bin/sed -e '/rows selected/d' /aemu/CALLAUTO/callauto.txt > /aemu/CALLAUTO/callautonew.txt
/usr/xpg4/bin/sed -e '/^$/d' /aemu/CALLAUTO/callautonew.txt > /aemu/CALLAUTO/callauto_new.txt
exit (1 Reply)
Discussion started by: aemunathan
1 Replies
6. Shell Programming and Scripting
When I run this:
PDHDURL=`/usr/bin/curl --silent http://www.phdcomics.com/comics.php | /usr/bin/grep -o http://www.phdcomics.com/comics/archive/.*.gif | head -1`
echo -e "$PHDURL"
It is totally blank. However, when I just run it from the terminal:
/usr/bin/curl --silent... (2 Replies)
Discussion started by: killer54291
2 Replies
7. Shell Programming and Scripting
My script ssh's to another server and gathers information then process them. The problem is that the output of a command has an unwanted "blank lines".
...
ssh user1@${server1} /usr/bin/ls -l /tmp/file1 | awk '{print $5}' > ${DATAFILE}
...
$ cat ${DATAFILE}
123456789 (There's a blank... (7 Replies)
Discussion started by: pdtak
7 Replies
8. Shell Programming and Scripting
I've got a report I need to make easier to read Using sh on HP-UX 11.12.
In short, I want to search for a regular expression and when found, examine the next line to see if it's blank. If so, then delete both lines. If not blank, move on to the next regexp. Repeat.
So far I've got:
... (7 Replies)
Discussion started by: Scottie1954
7 Replies
9. Shell Programming and Scripting
Hello,
I have a file that I want to be able to insert a new line before every instance of a regex. I can get it to do this for each line that contains the regex, but not for each instance.
Contents of infile:
Test this 1...
Test this 2...
Test this 3... Test this 4... Test this... (2 Replies)
Discussion started by: deneuve01
2 Replies
10. UNIX for Beginners Questions & Answers
Under one of my directories on server I have more than 500 files with different type and name. When I run the find command to list the files with 'ABC_DEFGH' in the begining of its name and older than 20 days, nothing is return as result. Though I know there are more than 400 files which their name... (10 Replies)
Discussion started by: Home
10 Replies
LEARN ABOUT DEBIAN
amc-annote
AMC-ANNOTE(1) Auto Multiple Choice AMC-ANNOTE(1)
NAME
AMC-annote - completed answer sheets annotation after marking for AMC multiple choice exams.
SYNOPSIS
auto-multiple-choice annote --projet project-dir --data project-data-dir --fich-assoc assoc.xml [annotation options...]
DESCRIPTION
The AMC-annote.pl command annotates papers scans with scores for all questions, global score and mark, resulting in JPEG files (one for
each page).
--projet project-dir
sets the project directory.
--data project-data-dir
gives the directory where data files are (see for example AMC-prepare(1)).
--cr project-cr-dir
sets the project reports directory, where to find data capture reports prepared by AMC-analyse(1), and where to output annotated scans.
Default value is project-dir/cr.
--fich-noms students-list.csv
sets the students list file name.
--noms-encodage encoding
selects an encoding for file students-list.csv (default is utf-8).
--qualite qual
sets JPEG quality for output files. Default value is 65.
--taille-max maxsize
sets the maximal size for output files (in the format widthxheight, in pixels). Default value is 1000x1500.
--pointsize-nl lines
sets the size of texts requiring that with this size, the number of text lines that fits on the page height must be lines. Default
value is 60.
--verdict header
sets the text header to be printed on each first page of the students copies. This text may contain CR characters for multi-line
headers. Some sequences are substituted in it:
%S
is replaced by the student total score.
%M
is replaced by the maximum total score.
%s
is replaced by the student mark.
%m
is replaced by the maximum mark.
%(ID)
is replaced by the student's name.
%(COL)
is replaced by the value of column COL in the students list for the curent student.
--ch-sign nc
Sets the number nc of significant digits to use when printing global mark.
--symbols symbols-definition
defines how boxes will be annotated. symbols-definition is a comma separated list of H-A:shape:colour constructs, where H is 0 or 1
depending on wether the box has to be checked or not, A is 0 or 1 depending on wether the box is actually checked or not, shape is one
of none, circle, mark, box and coulour is a colour (name or #RGB, see ImageMagick or GraphicsMagick documentation for details). Default
value is "0-0:none,0-1:circle:red,1-0:mark:red,1-1:mark:blue".
--position pos
sets the position of individual questions scores. pos may be 'none' (do dot write individual scores), 'marge' (write scores in the
margin) or 'case' (write scores at the left of the left-most box for the question.
--ecart dx
sets the horizontal space to let between individual question score and the leftmost box when --position case is used.
--ecart-marge x
sets the x position for individual questions scores when written in the margin (in em units).
--line-width lw
sets the line width for symbols drwan on the scans (in pixels). Default value is 2.
--indicatives bool
say if indicative questions are to be annotated (use 1 for a true value; default is false).
--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-ANNOTE(1)