10-25-2013
Want to remove all lines but not latest 50,000 lines from a file
Hi,
I have a huge file which has Lacs of lines. File system got full.
I want your guys help to suggest me a solution so that I can remove all lines from that file but not last 50,000 lines. I want solution which can remove lines from existing file so that I can have some space left with.
Last edited by prashant2507198; 10-25-2013 at 05:40 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
file:
1 xxxxxxx
2 xxx xxx
5 xxx xxx
...
180 xxxxxx
200 xxx
how to remove any lines with the first number range 1-180 (9 Replies)
Discussion started by: bluemoon1
9 Replies
2. Shell Programming and Scripting
Hi,
There seems to some hack attempts in my site. I have attached the index page of my site and I need to remove the below lines from the index page. The below lines are at the center of the file.
-->
</style>
<script>E V A L( unescape(... (5 Replies)
Discussion started by: gsiva
5 Replies
3. UNIX for Dummies Questions & Answers
All,
I have a text file with several entries like below:
personname
personname.domain.com
I know there is a way to use vi to remove only the personname.domain.com line. Can someone help? I believe that it involves /s/g/ something...I just can't remember the exact syntax.
Thanks (2 Replies)
Discussion started by: kjbaumann
2 Replies
4. Shell Programming and Scripting
Hi gurus,
i'm trying to remove a number of lines from a large file using the following command:
sed '1,5000d' oldfile > newfile
Somehow the lines in the old file are not deleted...
Am I doing this wrongly? Any suggestions? :confused:
Thanks! :)
wee (10 Replies)
Discussion started by: lweegp
10 Replies
5. Shell Programming and Scripting
A small question
I have a test.txt file
I have contents as:
a:google
b:yahoo
:
c:facebook
:
d:hotmail
How do I remove the line with :
my output should be
a:google
b:yahoo
c:facebook
d:hotmail (5 Replies)
Discussion started by: aronmelon
5 Replies
6. Shell Programming and Scripting
Hi,
I'm not a expert in shell programming, so i've come here to take help from u gurus.
I'm trying to tailor a csv file that i got to make it work for the LOAD FROM command.
I've a datatable csv of the below format -
--in file format
xx,xx,xx ,xx , , , , ,,xx,
xxxx,, ,, xxx,... (11 Replies)
Discussion started by: dvah
11 Replies
7. Shell Programming and Scripting
Hey Gang-
I have a list of servers. I want to exclude servers that begin with and end with certain characters. Is there an easy command to do this?
Example
wvm1234dev
wvm1234pro
uvm1122dev
uvm1122bku
uvm1344dev
I want to exclude any lines that start with "wvm" OR "uvm" AND end... (7 Replies)
Discussion started by: idiotboy
7 Replies
8. Shell Programming and Scripting
I have two files, a keepout.txt and a database.csv. They're unsorted, but could be sorted.
keepout:
user1
buser3
anuser19
notheruser27
database:
user1,2343,"information about",field,blah,34
user2,4231,"mo info",etc,stuff,43
notheruser27,4344,"hiya",thing,more thing,423... (4 Replies)
Discussion started by: esoffron
4 Replies
9. Shell Programming and Scripting
Hello everyone,
Although it seems easy, I've been stuck with this problem for a moment now and I can't figure out a way to get it done.
My problem is the following:
I have a file where each line is a sequence of IP addresses, example :
10.0.0.1 10.0.0.2
10.0.0.5 10.0.0.1 10.0.0.2... (5 Replies)
Discussion started by: MisterJellyBean
5 Replies
10. Shell Programming and Scripting
I have been searching and trying to come up with an awk that will perform the following on a
converted text file (original is a pdf).
1. Since the first two lines are (begin with) text they are removed
2. if $1 is a number then all text is merged (combined) into one line until the next... (3 Replies)
Discussion started by: cmccabe
3 Replies
LEARN ABOUT SUSE
prunehistory
PRUNEHISTORY(8) InterNetNews Documentation PRUNEHISTORY(8)
NAME
prunehistory - Remove tokens from Usenet history file
SYNOPSIS
prunehistory [-p] [-f filename]
DESCRIPTION
prunehistory modifies a history(5)-format text file to "remove" a set of tokens from it. The tokens are removed by overwriting them with
spaces, so that the size and position of any following entries does not change. This has an effect similar to expiring the article, in
that it is still mentioned in the history database but cannot be retrieved.
prunehistory reads the standard input. The input is taken as a set of lines. Blank lines and lines starting with a number sign ("#") are
ignored. All other lines should consist of a message-ID followed by zero or more other fields (which are ignored). The message-ID is used
as the dbz(3) key to get an offset into the text file. Since innd only appends to the text file, prunehistory does not need to have any
interaction with it.
OPTIONS
-p prunehistory will normally complain about lines that do not follow the correct format. If the -p flag is used, then the program will
silently print any invalid lines on its standard output. (Blank lines and comment lines are also passed through.)
This can be useful when prunehistory is used as a filter for other programs such as reap (a legacy program, probably no longer useful
with current versions of INN, but still available at <ftp://ftp.ruhr-uni-bochum.de/.subdisc1/local/jk.collection/>).
-f filename
The default name of the history file is pathdb/history; to specify a different name, use the -f flag.
HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. Converted to POD by Julien Elie.
$Id: prunehistory.pod 8592 2009-08-20 23:46:25Z eagle $
SEE ALSO
dbz(3), history(5), innd(8).
INN 2.5.2 2009-09-11 PRUNEHISTORY(8)