Keywords: Open Office, MSDOS line endings, a .txt file opens in Open Office Calc
I noted the following odd peculiarity recently. When opening a plain text file with the .txt extension using Open Office either on Windows with the MSDOS \r\n “CRLF” line endings or on Unix with Unix \n “LF” line endings, Open Office Writer correctly opens the file without complaint. However, when opening a plain text file with MSDOS “CRLF” line endings on Unix, Open Office tries to import the text file into a spreadsheet and pops a dialog. I don’t know if that is intended behavior or not, but it is useful to know if you’re processing text files in a Unix envoronment. This was observed in Open Office 2.4.
Update June 3, 2008 I reported this to Open Office with some extra details. Again I don’t know if it is a bug, but you should probably be aware of text file line endings, and have tools ready to change them if necessary.
I apologize in advance if you are not the right person to whom to address this issue.
The gist is that ASCII “.txt” documents that happen to have a “\r” in them will open in Calc with a popup asking for details on column delimiters on Linux and OSX versions of Open Office, but they open in Writer on the Windows version of Open Office. So for example, there may be inconsistent behavior for text files created on Windows and then later opened on a Unix platform. When I change the line ending byte sequence to the one expected on the given platform, the “.txt” file opens in Writer.
.txt Created On Line Ending Opened On Opens With --------------- ----------- ------------- ----------- Mac Classic (OS9) "\r" CR OSX, Linux Calc Mac Classic (OS9) "\r" CR Windows Writer Windows "\r\n" CRLF OSX, Linux Calc Windows "\r\n" CRLF Windows Writer OSX, Linux "\n" LF OSX, Linux Writer OSX, Linux "\n" LF Windows Writer
Furthermore, removing the “.txt” extension causes the file to open in Writer in all cases following a popup question about the character encoding.
The issue is described (in evolutionary detail ;-) in this forum thread along with some investigations: http://www.oooforum.org/forum/viewtopic.phtml?t=71772 I used OO 2.4 on Fedora Core 7, OO 2.4 on Ubuntu 8.04, OO 2.3 on Windows and OO 2.4 on OSX.