Find a block of text and if a certain keyword exists, remove another block of text within that block
Platform: CentOS Linux
Language: Shell
Hello. So I have a text file named goob, containing the following contents:
What needs to happen is for all functions with type "scythe", I need to remove the whole block of their value-b such that the result would be
Any ideas? Thanks in advance.
Last edited by pulpwilkes; 04-28-2020 at 12:19 AM..
Need to delete a text block inside a file, that is marked with a start and an end pattern. Eg
do not delete
not delete
<tag1>
delete everything here
here
and here
and here...
<tag2>
do not delete
do not delete....
Believe sed is able to do this job but don't get it working.
... (1 Reply)
I'm having a couple of issues. I'm trying to edit a nagios config and remove a host definition if a certain "host_name" is found. My thought is I would find host definition block containing the host_name I'm looking for and output the line numbers for the first and last lines. Using set, I will... (9 Replies)
Hello all,
I have a text files that consists of blocks of text. Each block of text represents a set of Cartesian coordinates for a molecule. Each block of text starts with a line that has a only a number, which is equal to the total number of atoms in the molecule. After this number is a line... (15 Replies)
Input:
fstab is a configuration
file that contains information
of all the partitions
and storage devices
in your computer.
The file is located under /etc,
so the full path
to this file is /etc/fstab.
The >>>>> characters would be replaced by some texts.
For example if i run a... (5 Replies)
Hello all,
I have a large output file from which I would like to extract a single block of text.
An example block of text is shown below:
***** EQUILIBRIUM GEOMETRY LOCATED *****
COORDINATES OF ALL ATOMS ARE (ANGS)
ATOM CHARGE X Y Z
... (10 Replies)
Hello,
Although I have found similar questions, I could not find advice that
could help with our problem.
The issue:
We have several hundreds text files containing repeated blocks of text
(I guess back at the time they were prepared like that to optmize
printing).
The block of texts... (13 Replies)
Hi
I am looking for the way to delete the block of data for example
original file
line1
line2
line3
line4
line5
input file
line2
line3
original file should contain
line1
line4
line5 (3 Replies)
Hi,
I have a requirement in which i need to replace text as below -
<stringProp name="Recipe"><AddGroup Name="1001" Path="ServiceAdministration/Controls/1001/ServiceSwitches">
<Param Name="AttributeName" Value="HeaderManipRspIngressRuleSet" Type="String" />
<Param Name="Value"... (0 Replies)
Hei buddies,
Need ur help once again.
I have a file which has bunch of lines which starts from a fixed pattern and ends with another fixed pattern.
I want to make use of these fixed starting and ending patterns to select the bunch, one at a time.
The input file is as follows.
Hi welcome... (12 Replies)
Hello all,
I am working on a script which should parse a large file called input.txt which contains table definitions, index definitions and comments like these ones:
------------------------------------------------
-- DDL Statements for table "CMWSYS"."CMWD_TEC_SUIVI_TRT"... (12 Replies)
Discussion started by: kiki_riki_miki
12 Replies
LEARN ABOUT DEBIAN
text::wikiformat::blocks
Text::WikiFormat::Blocks(3pm) User Contributed Perl Documentation Text::WikiFormat::Blocks(3pm)NAME
Text::WikiFormat::Blocks - blocktypes for Text::WikiFormat
SYNOPSIS
None. Use Text::WikiFormat as the public interface, unless you want to create your own block type.
DESCRIPTION
This module merely creates subclasses of Text::WikiFormat::Block, which is the interesting code. A block is a collection of related lines,
such as a code block (text to display verbatim in a monospaced font), a header, an unordered list, an ordered list, and a paragraph (text
to display in a proportional font).
Every block extends "Text::WikiFormat::Block".
METHODS
The following methods exist:
o "new( %args )"
Creates and returns a new block. The valid arguments are:
o "text"
The text of the line found in the block.
o "args"
The arguments captured by the block-identifying regular expression.
o "level"
The level of indentation for the block (usually only useful for list blocks).
o "tags"
The tags in effect for the current type of wiki formatting.
o "opts"
The options in effect for the current type of wiki formatting.
Use the accessors of the same names to retrieve the values of the attributes.
o "add_text( @lines_of_text )"
Adds a list of lines of text to the current text for the block. This is very useful when you encounter a block and want to merge it
with the previous block of the same type
o "add_args( @arguments )"
Adds further arguments to the block; useful when merging blocks.
o "formatted_text()"
Returns text formatted appropriately for this block. Blocks don't have to have formatters, but they may.
o "formatter( $line_of_text )"
Formats the $line using "Text::WikiFormat::format_line()". You can add your own formatter here; this is worth overriding.
o "merge( $next_block )"
Merges the current block with $next_block (the next block encountered) if they're of the same type and are at the same level. This
adds the text and args of $next_block to the current block. It's your responsibility to remove $next_block from whatever your code
iterates over.
o "nests()"
Returns true if this block should nest (as in lists and unordered lists) for the active wiki formatting.
o "nest( $next_block )"
Nests $next_block under this block if the both nest and if $next_block has a level greater than the current block. This actually adds
$next_block as a text item within the current block. Beware.
AUTHOR
chromatic, "chromatic at wgz dot org"
BUGS
No known bugs.
COPYRIGHT
Copyright (c) 2006, chromatic. Some rights reserved.
This module is free software; you can use, redistribute, and modify it under the same terms as Perl 5.8.x.
perl v5.10.1 2011-02-12 Text::WikiFormat::Blocks(3pm)