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)
Hello, maybe this post is offtopic, sorry for the inconveniencies (maybe should be in the forum with questions about C, C++, Java, SQL...).
I found examples about how to populate different fields from a text file (with MySQL, the LOAD DATA INFILE sentece), but not about how to load a complete... (2 Replies)
I am new to scripting and I needed to know if there would be an easy way to delete extra spaces in a text file. I have a file with three rows with 22 numbers each, but there is extra spaces between the numbers when it gets output by this program AFNI that I am using. What script would help delete... (2 Replies)
Hi,
Iam in a need for a script/function in KSH where I want to read a text file (property file) in block by block. Here is the example:
Heading Name Descripton
Block Block1 Value1 Description
Property Name Value
Property Name Value
Property Name Value
Property Name Value
Property Name... (7 Replies)
Hi Gurus,
I'm a total newbie to Perl and Awk scripting. Let me explain the scenario, there is a DB2 table with 5 columns and one of the column is a CLOB datatype containing XML. We need all the 4 columns but only a portion of string from the XML column.
We decided to export DB2 table to a .del... (26 Replies)
Hi everyone, is there any way in perl using which we can print the selective words in bold when we write the output to a csv file?
Please find the example below
1. Filename: A
2. name age 12
3. city add 23
Line1 should only be bold. Outputs from other files being read in the... (2 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)
Hello everyone,
I have a binary file with a structure unknown. I have found 2 perl scripts that it seems to do the convertion but I get sintactic errors when I run them, may somebody test these 2 scripts please and see if really work?
One if from here... (10 Replies)
Hi Folks,
I have an html file which contains the below line in the body tagI am trying the replace hello with Hello Giridhar programatically.
<body>
<P><STRONG><FONT face="comic sans ms,cursive,sans-serif"><EM>Hello</EM></FONT></STRONG></P>
</body>
I have written the below code to... (3 Replies)
Hi Folks,
Could you please share your ideas on extracting text from image file(jpg,png and gif formats).
Regards,
J (1 Reply)
Discussion started by: scriptscript
1 Replies
LEARN ABOUT DEBIAN
net::sieve::script::rule
Net::Sieve::Script::Rule(3pm) User Contributed Perl Documentation Net::Sieve::Script::Rule(3pm)NAME
Net::Sieve::Script::Rule - parse and write rules in sieve scripts
SYNOPSIS
use Net::Sieve::Script::Rule;
my $pRule = Net::Sieve::Script::Rule->new (
ctrl => $ctrl,
test_list => $test_list,
block => $block,
order => $order
);
or
my $rule = Net::Sieve::Script::Rule->new();
my $cond = Net::Sieve::Script::Condition->new('header');
$cond->match_type(':contains');
$cond->header_list('"Subject"');
$cond->key_list('"Re: Test2"');
my $actions = 'fileinto "INBOX.test"; stop;';
$rule->add_condition($cond);
$rule->add_action($actions);
print $rule->write;
DESCRIPTION CONSTRUCTOR
new
Arguments :
order => : optionnal set priority for rule
ctrl => : optionnal default 'if', else could be 'else', 'elsif'
or 'vacation'
test_list => : optionnal conditions by string or by Condition Object
block => : optionnal block of commands
Returns : Net::Sieve::Script::Rule object
Set accessors
alternate : as param ctrl
conditions : first condition in tree
actions : array of actions objects
priority : rule order in script, main id for rule
require :
METHODS
equals
return 1 if rules are equals
write
Return rule in text format
write_condition
set require for used conditions
return conditions in text format
write_action
set require for used actions
return actions in text format
delete_condition
Purpose : delete condition by rule, delete all block on delete anyof/allof
delete single anyof/allof block : single condition move up
Arguments : condition id
Returns : 1 on success, 0 on error
add_condition
Purpose : add condition to rule, add 'allof' group on second rule
Arguments : string or Condition object
Returns : new condition id or 0 on error
swap_actions
swap actions by order
return 1 on succes, 0 on failure
find_action
find action by order
Returns: Net::Sieve::Script::Action object, 0 on error
delete_action
delete action by order, first is 1;
add_action
Purpose : add action at end of block
Arguments : command line
or command line list with ; separator
or Net::Sieve::Script::Action object
Return : 1 on success
AUTHOR
Yves Agostini
CPAN ID: YVESAGO
Univ Metz
agostini@univ-metz.fr
http://www.crium.univ-metz.fr
COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.10.0 2008-09-15 Net::Sieve::Script::Rule(3pm)