05-06-2002
deleting lines
I am spooling a file from oracle and trying to delete the last line of the spooled file which I am unable to do.
Problem is that this file can have multiple records each time and I have no way of knowing how many because the amount can vary. I had an idea of using a while loop to read the file but I need to delete the last line which happans to be blank. Any suggustions would be helpful.
thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying deleting lines from a text file using sed..
sed '/OBJECT="ABC/{N;N;N;d; }'
will do if i have to delete lines starting with Object and next 3 lines
but I was looking for a way to delet lines starting with OBJECT and all the lines till it reaches a blank lines ..or it reaches a... (8 Replies)
Discussion started by: ajnabi
8 Replies
2. Shell Programming and Scripting
How do I delete all the lines after the line containing text ***DISCLOSURES*** . I want to delete this line too.
Thank you (2 Replies)
Discussion started by: reachsamir
2 Replies
3. Shell Programming and Scripting
Dear Friends
myself Avinash working in bash shell
The problem goes like this
I have a file called work.txt
assume that
first colum=mac address
second colum= IP
third colum = port number
----------------------------------------
00:12:23:34 192.168.50.1 2
00:12:23:35 192.168.50.1 5... (2 Replies)
Discussion started by: avi.skynet
2 Replies
4. Shell Programming and Scripting
I have a log file that I am processing. This contains messages from and to a server (requests and responses).
The responses to requests may not be in order i.e. we can have a response to a request after several requests are sent, and in some error cases there may not be any response message.
... (2 Replies)
Discussion started by: BootComp
2 Replies
5. UNIX for Advanced & Expert Users
How I can delete 100 lines anywhere in a file without opening a file and without renaming the file. (11 Replies)
Discussion started by: Nirgude07
11 Replies
6. Shell Programming and Scripting
Friends, I am executing this command in solaris sar -d 3 3 | awk 'NR > 2 { if ($1 !~ /,.+/) print }' | egrep -v "nfs|device" . Now i want to delete the last two lines of my output as they are records of average which i don't want. can some one pls give me some idea on how to proceed. (7 Replies)
Discussion started by: achak01
7 Replies
7. Shell Programming and Scripting
hi all,
i have got a scenario in which i need to delete all the lines that ends with file names.
e.g.
input can be
cms/images/services_icons/callback.png
cms/cms/images/services_icons/sync.php
cms/cms/images/services_icons
and output should be
cms/cms/images/services_icons
... (13 Replies)
Discussion started by: kashifv
13 Replies
8. Shell Programming and Scripting
We have a server that logs transactions to a file. I want to write a script that will delete the first 50 lines of the file daily without renameing the file or moving the file. (8 Replies)
Discussion started by: daveisme
8 Replies
9. Shell Programming and Scripting
Hello, im using ex to manipulate some text. Im trying to delete all the lines except those on which a certain regex can be found.
the important part of the script:
ex temp << 'HERE'
g/regex/p
HERE
this command prints the lines I want to end up with, but it doesnt delete the others.... (2 Replies)
Discussion started by: drareeg
2 Replies
10. Shell Programming and Scripting
Hi guys
I have a text file in the following format
what i would like ot do is iterate through the file deleting the lines containing only numbers. I have googled this and have been unable to find any help ( maybe its my search terms)
so if any one an give me a heads up i would... (3 Replies)
Discussion started by: dunryc
3 Replies
LEARN ABOUT DEBIAN
delete-pr
delete-pr(8) GNATS Admininstration Utilities delete-pr(8)
NAME
delete-pr - deletes closed PRs
SYNOPSIS
delete-pr
[ -V | --version ] | [ -h | --help ] |
[ -d name | --database=name ] [ -c | --closed | PR ]
DESCRIPTION
Deletes the specified PR, or if the --closed option is given, all of the closed PRs in the database are deleted.
delete-pr must be run by the GNATS user (by default gnats).
Note that deleting PRs is generally a very bad idea. It flies in the face of the very idea of using a Problem Reporting system and should
only be considered in special situations. Such a situation might for instance arise if a mail loop causes mass duplicate submissions or if
you receive spam to the PR submission e-mail address.
OPTIONS
-V, --version
Prints the program version to stdout and exits.
-h, --help
Prints a short help text to stdout and exits.
-d, --database
Specifies the database from which the PR(s) are to be deleted. If no database is specified, the database named default is assumed.
This option overrides the database specified in the GNATSDB environment variable.
--closed
Requests that all closed PRs in the database be deleted.
PR Requests that the specified PR be deleted. The PR must be in a closed state.
ENVIRONMENT VARIABLES
The GNATSDB environment variable is used to determine which database to use. For a local database, it contains the name of the database to
access.
For network access via gnatsd, it contains a colon-separated list of strings that describe the remote database, in the form
server:port:databasename:username:password
Any of the fields may be omitted, but at least one colon must appear; otherwise, the value is assumed to be the name of a local database.
If GNATSDB is not set and the --database option is not supplied, it is assumed that the database is local and that its name is default.
SEE ALSO
Keeping Track: Managing Messages With GNATS (also installed as the GNU Info file gnats.info) and Reporting Problems Using send-pr (also in-
stalled as the GNU Info file send-pr.info).
databases(5), dbconfig(5), delete-pr(8), edit-pr(1) file-pr(8), gen-index(8), gnats(7), gnatsd(8), mkcat(8), mkdb(8), pr-edit(8), query-
pr(1), queue-pr(8), send-pr(1).
COPYING
Copyright (c) 1999, 2003, Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the
entire resulting derived work is distributed under the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified
versions, except that this permission notice may be included in translations approved by the Free Software Foundation instead of in the
original English.
GNATS
August 2003 delete-pr(8)