Hi all,
I've been trying to get this to work for ages to no avail. I've searched this site and googled but cannot find a satisfactory answer.
I've got a while loop, like this
while read line
do
echo "$line"
done < file_name
Now, my problem is that most of the lines in the file... (3 Replies)
Hmmm... Bash doesn't parse whitespace with a read.
lev@sys09:~$ read line; echo "$line"
test
test
You can imagine what this does if you're using a shell script to read a list of unknown file names containing unknown spaces.
lev@sys09:~$ read word1 word2; echo "$word1,$word2"
123 456... (2 Replies)
I obviously haven't learned my lesson with shell and whitespace.
find /path/to/some/where/ -name "*.pdf" | awk '{print $5}'| uniq -d
results:
some Corporation
other Corporate junk
firmx
Works fine from cmdline but the whitespace turns into another FS in a for loop.
for... (7 Replies)
Hi,
I have a for loop which iterates over a list of strings, separated by whitespace:
$ list="1 2 3"
$ for i in $list; do echo $i; done
1
2
3
I now want to introduce some strings containing whitespace themselves ... This is straightforward if I directly iterate over the list:
$ for... (4 Replies)
I want to create a temp file which is named based on a search string. The search string may contain spaces or characters that aren't supposed to be used in filenames so I want to strip those out.
My thought was to use 'tr' with but the result is the opposite of what I want:
$ echo "test... (5 Replies)
Hi
Following is an example line.
echo "192.22.22.22 \"33dffwef\" 200 300 dsdsd" | sed "s:\(\ *\ \):\1:"
I want it's output to be
200
However this is not the case. Can you tell me how to do it? I don't want to use AWK for this. Secondly, how can i fetch just 300? Should I use "\2"... (3 Replies)
Daily stupid question. I want to increment the file name everytime the script is run. So for example if the filename is manager.log and I run the script, I want the next sequence to be manager.log1. So to be clear I only want it to increment when the script is executed. So
./script... (10 Replies)
Having issues with an expect script. I've been scripting bash, python, etc... for a couple years now, but just started to try and use Expect. Trying to create a script that takes in some arguments, and then for now, just runs a pwd command(for testing, final will be command I pass).
Here is... (0 Replies)
I am trying to do in a single line to take a list of paths separated by whitespace and then loop thru all the paths that were wrote but my regex is not working,
I have
echo {3} | sed 's/ //g' | while read EACHFILE
do
.....
But for some reason is only taking always the first path that I... (7 Replies)
Create a single bash script that does the following:
a. Print out the number of occurrences for each motif that is found in the bacterial genome and output to a file called motif_count.txt
b. Create a fasta file for each motif (so 3 in total) which contains all of the genes and their... (6 Replies)
Discussion started by: dre
6 Replies
LEARN ABOUT DEBIAN
openoffice::oodoc::manifest
OODoc::Manifest(3pm) User Contributed Perl Documentation OODoc::Manifest(3pm)NAME
OpenOffice::OODoc::Manifest - Access to document file descriptor
DESCRIPTION
The OpenOffice::OODoc::manifest class is a specialist derivative of OpenOffice::OODoc::XPath allowing access to the content descriptor of
an OpenDocument or OpenOffice.org file.
For ordinary content processing applications, it's not absolutely necessary to control the manifest. Member imports or deletions (ex:
createImageElement() in OpenOffice::OODoc::Image, raw_delete() in OpenOffice::OODoc::File) may make the real content inconsistent with the
manifest. Up to now, the OpenOffice.org desktop suite don't worry about that. However, OpenOffice::OODoc::Manifest provides a few number of
easy to use methods to get or set any entry in the manifest. In addition, it allows the users (at their own risks) to create or update any
kind of special entry or mime type, without control. There is no automatic consistency check between the manifest and the real content (but
this check and others could be easily developed with the combination of this module and the other ones).
The manifest (i.e. the "META-INF/manifest.xml" part of an ODF package) is a special member that describes the MIME types and the full
internal paths of the other members.
Methods
Constructor : OpenOffice::OODoc::Manifest->new(<parameters>)
Short Form: odfManifest(<parameters>)
See OpenOffice::OODoc::XPath->new
The XML member loaded by default is 'META-INF/manifest.xml'.
Example:
$my manifest = OpenOffice::OODoc::Manifest>new
(
file => 'document.odt'
);
returns a new object which represents the member list of an
ODF-compliant "document.odt" file.
getEntry($entry)
Returns the element (if any) corresponding to the given member.
Example:
my $element = $manifest->getEntry("content.xml");
Returns the element describing the "content.xml" member of the
file, if this element is defined.
getMainType()
Returns the main MIME type of the document.
For example, this type is
"application/vnd.oasis.opendocument.text"
for an OpenDocument text file or
"application/vnd.oasis.opendocument.presentation"
for an OpenDocument presentation, or
"application/vnd.sun.xml.writer"
for an OpenOffice.org 1.0 text file, etc.
See the Appendix C in the OASIS OpenDocument 1.0 specification
for a complete list of OpenDocument-compliant MIME types.
getType($entry)
Returns the media (mime) type of the given member.
removeEntry($entry)
Deletes the named entry.
setEntry($entry, $type)
Sets the mime type of an entry element. If the element was not
previously existing, it's created.
Returns the new element in case of success, undef otherwise.
Example:
my $element = $manifest->setEntry
("content.xml", "text/xml");
This instruction first creates (if needed) an entry for the member
"content.xml" and sets its media type to "text/xml".
setMainEntry($type)
Sets the main MIME type of the document.
Risky; not for ordinary use. But nobody prevents you from giving
a presentation or spreadsheet MIME type to a Writer document !
Properties
As for OpenOffice::OODoc::XPath
Exported functions
None
NOTES
See OpenOffice::OODoc::Notes(3) for the footnote citations ([n]) included in this page.
AUTHOR /COPYRIGHT
Developer/Maintainer: Jean-Marie Gouarne <http://jean.marie.gouarne.online.fr>
Contact: jmgdoc@cpan.org
Copyright 2004-2008 by Genicorp, S.A. <http://www.genicorp.com>
Initial English version of the reference manual by Graeme A. Hunter (graeme.hunter@zen.co.uk).
License: GNU Lesser General Public License v2.1
perl v5.14.2 2008-09-16 OODoc::Manifest(3pm)