Skip to content

use "<text:p>" instead of "<text:line-break/>" for newlines (line breaks) in cells #41

Open
@ckhung

Description

@ckhung

Hi, I wrote a script odsfiles2col.py to combine a bunch of text files into an ods file of two columns, with file names as the key column and file contents as the value column. For example odsfiles2col.py pineapple.txt raspberry.txt would create this file: out.ods . You can see that the line breaks in the text files disappear. So I found this thread and did the following:

mkdir tmp
cd tmp
unzip ../out.ods
perl -i -pe 's#<text:line-break/>#</text:p><text:p>#g' content.xml
zip -r ../fixed.ods .

and the newlines are now correctly shown in the newly created fixed.ods file. Should we do that in the first place when writing out the ods file?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions