File: text2odf

package info (click to toggle)
libopenoffice-oodoc-perl 2.125-3
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 1,660 kB
  • ctags: 603
  • sloc: perl: 11,126; makefile: 12; xml: 11
file content (33 lines) | stat: -rw-r--r-- 905 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/perl -w
#-----------------------------------------------------------------------------
#	$Id : text2odf 0.2 2008-05-04 JMG$
#-----------------------------------------------------------------------------

=head1	NAME

text2odf - Text to OpenDocument conversion

=head1	SYNOPSIS

cat sourcefile.txt | text2odf targetfile.odt

=head1	DESCRIPTION

This filter creates an OpenDocument (ODF) file and fills it
with the text coming through the standard entry. The target file is
created, and any existing file with the same name is replaced.
To avoid this behaviour and append the text to an existing ODF file,
just remove the create => 'text' option in the script.

=cut

use	OpenOffice::OODoc	2.101;

die "Missing target filename\n" unless $ARGV[0];
my $doc = odfDocument(file => $ARGV[0], create => 'text');
while (my $line = <STDIN>)
	{
	$doc->appendParagraph(text => $line);
	}
$doc->save;
exit;