Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ckhung opened this issue Aug 14, 2021 · 0 comments

Comments

@ckhung
Copy link

ckhung commented Aug 14, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant