12-27-2012
Deleting all lines containing numbers
Hi guys
I have a text file in the following format
Quote:
1410054
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec diam dui,
congue sed tristique eget, pulvinar in enim. Nam tortor odio, rhoncus
sit amet suscipit eget, fringilla non purus. Donec non condimentum neque.
Praesent adipiscing nibh at mauris aliquam non fermentum dolor adipiscing.
Ut dolor mauris, condimentum in dapibus non, convallis vitae quam. Aenean
tincidunt justo at magna congue condimentum. Vestibulum lacus nisl, portt
1410187
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec diam dui,
congue sed tristique eget, pulvinar in enim. Nam tortor odio, rhoncus
sit amet suscipit eget, fringilla non purus. Donec non condimentum neque.
Praesent adipiscing nibh at mauris aliquam non fermentum dolor adipiscing.
Ut dolor mauris, condimentum in dapibus non, convallis vitae quam. Aenean
tincidunt justo at magna congue condimentum. Vestibulum lacus nisl, portt
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 appreciate it
dunryc
10 More Discussions You Might Find Interesting
1. Programming
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... (1 Reply)
Discussion started by: supercbw
1 Replies
2. 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
3. Shell Programming and Scripting
Hi,
I have a file that gets automatically generated and it would look something like
sakjsd
adssad
{{word}}
sddsasd
dsdsasa
.
.
.
So basically what I want to do is just keep the stuff below the {{word}} marker. The marker includes the brackets. Is there any command to delete the... (3 Replies)
Discussion started by: eltinator
3 Replies
4. 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
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
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
7. 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
8. Shell Programming and Scripting
Title says all :p
Thanks for your help (4 Replies)
Discussion started by: drbiloukos
4 Replies
9. UNIX for Dummies Questions & Answers
I have a directory question where I ask the user which entry he wants to delete...
echo "Which entry?"
read entry
sed '/^'$entry'/d' file
This code does in fact delete that particular entry...
HOWEVER, when I go to inquire about that same entry, it still populates like it was never... (4 Replies)
Discussion started by: itech4814
4 Replies
10. Shell Programming and Scripting
Hi All,
I want to write a script which first check the line counts of a file if its more than 500 it deletes rest except the last 500..
I tried sed but it looks sed counts line numbers from the head & not from tail.. May be I need a wc -l frist then apply if statement & pass on the line count... (17 Replies)
Discussion started by: ailnilanjan
17 Replies
LEARN ABOUT DEBIAN
text::greeking
Text::Greeking(3pm) User Contributed Perl Documentation Text::Greeking(3pm)
NAME
Text::Greeking - a module for generating meaningless text that creates the illusion of the finished document.
SYNOPSIS
#!/usr/bin/perl -w
use strict;
use Text::Greeking;
my $g = Text::Greeking->new;
$g->paragraphs(1,2) # min of 1 paragraph and a max of 2
$g->sentences(2,5) # min of 2 sentences per paragraph and a max of 5
$g->words(8,16) # min of 8 words per sentence and a max of 16
print $g->generate; # use default Lorem Ipsum source
DESCRIPTION
Greeking is the use of random letters or marks to show the overall appearance of a printed page without showing the actual text. Greeking
is used to make it easy to judge the overall appearance of a document without being distracted by the meaning of the text.
This is a module is for quickly generating varying meaningless text from any source to create this illusion of the content in systems.
This module was created to quickly give developers simulated content to fill systems with simulated content. Instead of static Lorem Ipsum
text, by using randomly generated text and optionally varying word sources, repetitive and monotonous patterns that do not represent real
system usage is avoided.
METHODS
Text::Greeking->new
Constructor method. Returns a new instance of the class.
$g->init
Initializes object with defaults. Called by the constructor. Broken out for easy overloading to enable customized defaults and other
behaviour.
$g->sources([@ARRAY])
Gets/sets the table of source word collections current in memory as an ARRAY reference
$g->add_source($text)
The class takes a body of text passed as a SCALAR and processes it into a list of word tokens for use in generating random filler text
later.
$g->generate
Returns a body of random text generated from a randomly selected source using the minimum and maximum values set by paragraphs,
sentences, and words minimum and maximum values. If generate is called without any sources a standard Lorem Ipsum block is used added
to the sources and then used for processing the random text.
$g->paragraphs($min,$max)
Sets the minimum and maximum number of paragraphs to generate. Default is a minimum of 2 and a maximum of 8.
$g->sentences($min,$max)
Sets the minimum and maximum number of sentences to generate per paragraph. Default is a minimum of 2 and a maximum of 8.
$g->words($min,$max)
Sets the minimum and maximum number of words to generate per sentence. Default is a minimum of 5 and a maximum of 15.
SEE ALSO
http://en.wikipedia.org/wiki/Greeking
TO DO
HTML output mode including random hyperlinked phrases.
Configurable punctuation controls.
PARTICIPATION
I welcome and accept patches in diff format. If you wish to hack on this code, please fork the git repository found at:
<http://github.com/tima/perl-text-greeking/>. If you have something to push back to my repository, just use the "pull request" button on
the github site.
LICENSE
The software is released under the Artistic License. The terms of the Artistic License are described at
<http://www.perl.com/language/misc/Artistic.html>.
AUTHOR & COPYRIGHT
Except where otherwise noted, Text::Greeking is Copyright 2005-2009, Timothy Appnel, tima@cpan.org. All rights reserved.
perl v5.10.0 2009-08-28 Text::Greeking(3pm)