Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How get only required lines & delete the rest of the lines in file Post 302426138 by dennis.jacob on Tuesday 1st of June 2010 01:48:04 AM
Old 06-01-2010
Try:

Code:
sed '/ *PDE/!d' a.out

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help required regarding Extracting lines from a file

I have a file containing the following contents All of us, including Zippy, our dog All of us, including Zippy and Zippy All of us, including Zippy and Zippy and Zelda Testing All of us Zippy Now, i wanna grep and get the lines which has only one occurance of word Zippy and starting with... (1 Reply)
Discussion started by: google_ever
1 Replies

2. Shell Programming and Scripting

SED: match pattern & delete matched lines

Hi all, I have the following data in a file x.csv: > ,this is some text here > ,,,,,,,,,,,,,,,,2006/11/16,0.23 > ,,,,,,,,,,,,,,,,2006/12/16,0.88 < ,,,,,,,,,,,,,,,,this shouldnt be deleted I need to use SED to match anything with a > in the line and delete that line, can someone help... (7 Replies)
Discussion started by: not4google
7 Replies

3. Shell Programming and Scripting

To extract the required lines from a file

I have a files in a directory in this format data data data ---BEGIN CERT----- data data data ---END CERT ----- Now, I want to extract the lines starting from --BEGIN CERT-- and write the contents till the end of file into a new file.How can I do this for all the files in the... (1 Reply)
Discussion started by: sureshg
1 Replies

4. Shell Programming and Scripting

How to delete lines in a file that have duplicates or derive the lines that aper once

Input: a b b c d d I need: a c I know how to get this (the lines that have duplicates) : b d sort file | uniq -d But i need opossite of this. I have searched the forum and other places as well, but have found solution for everything except this variant of the problem. (3 Replies)
Discussion started by: necroman08
3 Replies

5. UNIX for Advanced & Expert Users

In a huge file, Delete duplicate lines leaving unique lines

Hi All, I have a very huge file (4GB) which has duplicate lines. I want to delete duplicate lines leaving unique lines. Sort, uniq, awk '!x++' are not working as its running out of buffer space. I dont know if this works : I want to read each line of the File in a For Loop, and want to... (16 Replies)
Discussion started by: krishnix
16 Replies

6. Shell Programming and Scripting

search and replace, when found, delete multiple lines, add new set of lines?

hey guys, I tried searching but most 'search and replace' questions are related to one liners. Say I have a file to be replaced that has the following: $ cat testing.txt TESTING AAA BBB CCC DDD EEE FFF GGG HHH ENDTESTING This is the input file: (3 Replies)
Discussion started by: DeuceLee
3 Replies

7. Shell Programming and Scripting

Sed/awk to delete single lines that aren't touching other lines

Hello, I'm trying to figure out how to use sed or awk to delete single lines in a file. By single, I mean lines that are not touching any other lines (just one line with white space above and below). Example: one two three four five six seven eight I want it to look like: (6 Replies)
Discussion started by: slimjbe
6 Replies

8. Shell Programming and Scripting

Delete 40 lines after every 24 lines from a file

Hello, I have file of more than 10000 lines. I want to delete 40 lines after every 20 lines. e.g from a huge file, i want to delete line no from 34 - 74, then 94 - 134 etc and so on. Please let me know how i can do it. Best regards, (11 Replies)
Discussion started by: nehashine
11 Replies

9. Shell Programming and Scripting

sed one liner to Delete blank lines - Help required

Hi, cat test.txt BlankLine BlankLine BlankLine BlankLine ello hi helo BlankLine BlankLine heylo BlankLine BlankLine BlankLine done BlankLine BlankLine BlankLine (1 Reply)
Discussion started by: TomG
1 Replies

10. UNIX for Beginners Questions & Answers

How to search & delete inclusively between two lines?

Hi all, I was wondering if anyone would know how to search & delete inclusively between two lines, please: Important: There are multiple }; lines. I'm curious how to delete the correct one only. Line numbers may vary each time this script is run. For example, I'd like to delete only the... (6 Replies)
Discussion started by: chatguy
6 Replies
HTML::Microformats::Datatype::Duration(3pm)		User Contributed Perl Documentation	       HTML::Microformats::Datatype::Duration(3pm)

NAME
HTML::Microformats::Datatype::Duration - floating periods of time SYNOPSIS
my $duration = HTML::Microformats::Datatype::Duration->new($d); print "$duration "; DESCRIPTION
Constructors "$d = HTML::Microformats::Datatype::Duration->new($duration)" Creates a new HTML::Microformats::Datatype::Duration object. $duration is a DateTime::Duration object. "$d = HTML::Microformats::Datatype::Duration->parse($string, $elem, $context)" Creates a new HTML::Microformats::Datatype::Duration object. $string is a duration represented in ISO 8601 format, for example: 'P1Y' or 'PT2H29M58.682S'. $elem is the XML::LibXML::Element being parsed. $context is the document context. The standard way of representing durations in Microformats is as an ISO 8601 string: <abbr class="duration" title="P4DT4H">4 and a half days</abbr> This constructor also supports a number of experimental microformat duration patterns. ISO-31 class names are supported: <div class="duration"> <span claa="d">4</span> and <abbr title="12" class="h">a half</abbr> days. </div> As are metric/SI measures (in seconds): <span class="duration">124 s</span> <span class="duration">124</span> seconds Or using an hMeasure microformat with no 'item' property, the 'type' property either absent or a case-insensitive match of 'duration' and a unit property of 's'/'sec'/'seconds', 'min'/'minutes', 'h'/'hours' or 'd'/'days'. For example: <span class="duration hmeasure"> <b class="unit">Days</b>: <span class="num">4.5</span> </span> Public Methods "$d->duration" Returns a DateTime::Duration object. "$d->to_string" Returns an ISO 8601 formatted string representing the duration. "$d->datatype" Returns an the RDF datatype URI representing the data type of this literal. Functions "compare($a, $b)" Compares durations $a and $b. Return values are as per 'cmp' (see perlfunc). Note that there is not always a consistent answer when comparing durations. 30 days is longer than a month in February, but shorter than a month in January. Durations are compared as if they were applied to the current datetime (i.e. now). This function is not exported by default. Can also be used as a method: $a->compare($b); "$c = add($a, $b)" Adds two durations together. This function is not exported by default. Can also be used as a method: $c = $a->add($b); "$c = subtract($a, $b)" Subtracts duration $b from $a. This function is not exported by default. Can also be used as a method: $c = $a->subtract($b); BUGS
Please report any bugs to <http://rt.cpan.org/>. SEE ALSO
HTML::Microformats, HTML::Microformats::Datatype, DateTime::Duration. AUTHOR
Toby Inkster <tobyink@cpan.org>. COPYRIGHT
Copyright 2008-2011 Toby Inkster This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. DISCLAIMER OF WARRANTIES
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. perl v5.14.2 2011-12-06 HTML::Microformats::Datatype::Duration(3pm)
All times are GMT -4. The time now is 10:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy