04-19-2013
Cut from specific line number to a line number
Hi All,
I've a file like this..
Sheet1
a,1
a,2
a,3
a,4
a,5
Sheet2
a,6
a,7
a,8
a,9
a,10
Sheet3
a,11
a,12
a,13
a,14
a,15
I want to cut data from line starting after Sheet2 to line before Sheet3. i.e my output will be like
a,6
a,7
a,8
a,9
a,10
Here, I don't know line number of string 'Sheet2' & 'Sheet3'. I've done googling & searched through this forum , but have not able to do it.
I'm sure you guys wont disappoint me..
Cheers
Last edited by manab86; 04-19-2013 at 03:20 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello, I need help in appending the line number of each line to the file and also to get the total number of lines. Can somebody please help me.
I have a file say:
abc
def
ccc
ddd
ffff
The output should be:
Instance1=abc
Instance2=def
Instance3=ccc
Instance4=ddd
Instance5=ffff
... (2 Replies)
Discussion started by: chiru_h
2 Replies
2. Shell Programming and Scripting
Hi,
I have a huge file & I want to add a specific text in column. But I want to add this text from a specific line number to a specific line number & another text in to another range of line numbers.
To be more specific: lets say my file has 1000 lines & 4 Columns. I want to add text "Hello"... (2 Replies)
Discussion started by: Ezy
2 Replies
3. Shell Programming and Scripting
Hi Everybody,
I am trying to write a script that will get some perticuler data from a file and redirect to a file.
My Question is,
I have a Very huge file,In that file I have my required data is started from 25th line and it will ends in 100th line.
I know the line numbers, I need to get all... (9 Replies)
Discussion started by: Anji
9 Replies
4. Shell Programming and Scripting
using sed to replace a specific string on a specific line number using variables
this is where i am at
grep -v WARNING output | grep -v spawn | grep -v Passphrase | grep -v Authentication | grep -v '/sbin/tfadmin netguard -C'| grep -v 'NETWORK>' >> output.clean
grep -n Destination... (2 Replies)
Discussion started by: todd.cutting
2 Replies
5. Shell Programming and Scripting
Hi guys ,
I m writing a script to delete a line at particular location.
But i m unable to use variable for specifying line number.
for example.
sed -n '7!p' filename
works fine and deletes 7th line from my file
but
sed -n '$variable!p' filename
gives following error.
sed: -e... (12 Replies)
Discussion started by: pinga123
12 Replies
6. UNIX for Dummies Questions & Answers
Hello Everyone.
I am trying to display contains of a file from a specific line to a specific line(let say, from line number 3 to line number 5). For this I got the shell script as shown below:
if ; then
if ; then
tail +$1 $3 | head -n $2
else
... (5 Replies)
Discussion started by: grc
5 Replies
7. Shell Programming and Scripting
Hi All, I have input file like this:
input1:
( 1083479)=T 158V 1798,
T 391V 1896,T 1138V 2273,T 1547V 2477,T 2249V 2917,T 3278V 3234,T 4152V 3495,T 5500V 3631,
( 1083501)=T 181V 1851,
T 459V 1954,T 810V 2141,T 1188V 2372,T 1638V 2696,T 2731V 3124,T 4799V 3640,... (5 Replies)
Discussion started by: attila
5 Replies
8. Shell Programming and Scripting
Hello everyone,
I don't really know anything about scripting, but I have to manage to make this script, out of necessity.
#!/bin/bash
while read -r line; do #I'm reading from a big wordlist
instructions using $line
done
Is there a way to automatically write the $line number the script... (4 Replies)
Discussion started by: bobylapointe
4 Replies
9. Shell Programming and Scripting
my requirement is,
consider a file output
cat output
blah sdjfhjkd jsdfhjksdh
sdfs 23423 sdfsdf sdf"sdfsdf"sdfsdf"""""dsf
hellow there
this doesnt look good
et cetc etc
etcetera
i want to replace a line of line number 4 ("this doesnt look good") with some other line
... (3 Replies)
Discussion started by: vivek d r
3 Replies
10. Shell Programming and Scripting
Dear Specialists,
I have following data
1 1 2
2 2 3
3 3 6
4 3 4
5 4 9
6 5 11
7 6 7
and I would like to obtain data like below
1 1 2
2 2 3
4 3 4
7 6 7 (2 Replies)
Discussion started by: Ryan Kim
2 Replies
LEARN ABOUT DEBIAN
net::akismet
Net::Akismet(3pm) User Contributed Perl Documentation Net::Akismet(3pm)
NAME
Net::Akismet - Perl interface to Akismet - comment and trackback spam fighter
SYNOPSIS
my $akismet = Net::Akismet->new(
KEY => 'secret-baba-API-key',
URL => 'http://example.blog.net/',
) or die('Key verification failure!');
my $verdict = $akismet->check(
USER_IP => '10.10.10.11',
COMMENT_USER_AGENT => 'Mozilla/5.0',
COMMENT_CONTENT => 'Run, Lola, Run, the spam will catch you!',
COMMENT_AUTHOR => 'dosser',
COMMENT_AUTHOR_EMAIL => 'dosser@subway.de',
REFERRER => 'http://lola.home/',
) or die('Is the server here?');
if ('true' eq $verdict) {
print "I found spam. I am a spam-founder!
";
}
METHODS
new()
Net::Akismet->new(PARAM => ...);
Acceptable parameters:
KEY The API key being verified for use with the API.
URL The front page or home URL of the instance making the request. For a blog or wiki this would be the front page.
USER_AGENT
If supplied the value is prepended to this module's identification string to become something like:
your-killer-app/0.042 Perl-Net-Akismet/0.01 libwww-perl/5.8
Otherwise just Akismet Perl's user agent string will be sent.
SERVICE_HOST
If supplied, the host of the service API. The default is rest.akismet.com
SERVICE_VERSION
If supplied, the API version. The default is 1.1
If verification of the key was unsuccessful "new()" returns "undef".
check()
$akismet->check(USER_IP => ..., COMMENT_CONTENT => ..., ...)
To be or not to be... "check" is meant to tell you. Give it enough details about the comment and expect 'true', 'false' or "undef"
as a result. 'true' means spam, 'false' means not spam, "undef" is returned on errror in submission of the comment.
Acceptable comment characteristics:
USER_IP
Required. Represents the IP address of the comment submitter.
COMMENT_USER_AGENT
Required. User agent string from the comment submitter's request.
COMMENT_CONTENT
Comment text.
REFERRER
HTTP "Referer" header.
PERMALINK
Permanent link to the subject of the comment.
COMMENT_TYPE
May be blank, 'comment', 'trackback', 'pingback', or a made up value like 'registration'.
COMMENT_AUTHOR
Name of submitter.
COMMENT_AUTHOR_EMAIL
Submitter e-mail.
COMMENT_AUTHOR_URL
Submitter web page.
spam() Reports a certain comment as spam. Accepts the same arguments as "check()".
In case of failed submission returns "undef", otherwise - a perl-known truth.
ham() This call is intended for the marking of false positives, things that were incorrectly marked as spam. It takes identical
arguments as "check()" and "spam()".
In case of failed submission returns "undef", otherwise - a perl-known truth.
NOTES
Although almost all comment characteristics are optional, performance can drop dramatically if you exclude certain elements. So please,
supply as much comment detail as possible.
SEE ALSO
o http://akismet.com/
o http://akismet.com/development/api/
AUTHOR
Nikolay Bachiyski <nb@nikolay.bg>
Help, modifications and bugfixes from:
o Peter Pentchev
o John Belmonte
COPYRIGHT AND LICENSE
Copyright (C) 2006, 2007, 2008 by Nikolay Bachiyski
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or,
at your option, any later version of Perl 5 you may have available.
$Id: Akismet.pm 38 2008-06-05 17:15:12Z humperdink $
perl v5.10.0 2008-06-05 Net::Akismet(3pm)