Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

This website is an archive and is no longer active
NeoOffice announcements have moved to the NeoOffice News website


Support
· Forums
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


  
NeoOffice :: View topic - Some txt files open in Calc
Some txt files open in Calc
 
   NeoOffice Forum Index -> NeoOffice Releases
View previous topic :: View next topic  
Author Message
Lorinda
Captain Mifune


Joined: Jun 20, 2006
Posts: 2051
Location: Midwest, USA

PostPosted: Wed Jun 02, 2010 3:22 pm    Post subject: Some txt files open in Calc

Today I scanned a document and ran it through the OCR program that came with my HP All-In-One (Readiris 9.0). That program then forwards the resulting txt file to NeoOffice. Instead of opening in Writer, I got a Text Import window; If I click OK, the thing opens as a table in Calc.

With some work, I was able to get it copied, pasted into Writer, then convert it from a table to text.

Since other txt files work fine, I'm assuming it's a problem with the format of the file as output by Readiris. The file opens fine in TextEdit.

If I make a simple change (e.g. correct the spelling of a word) and save it in TextEdit, it will open in Writer. But there's a lot of semi-gibberish at the beginning of the file that opens in Writer (that doesn't appear in TextEdit) and \ characters at the end of many lines.

The file is attached, along with a screenshot of the import window.

This happens both in 3.1.1 Beta running on a PPC machine with 10.4.11 (haven't upgraded there yet!) and 3.1.1 on an Intel machine with 10.6.3.

Lorinda

PS I don't have OOo installed, so I don't know if there's a difference between it and Neo in this regard.
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Wed Jun 02, 2010 3:50 pm    Post subject: Re: Some txt files open in Calc

Lorinda wrote:
Since other txt files work fine, I'm assuming it's a problem with the format of the file as output by Readiris. The file opens fine in TextEdit.


You are correct. The problem with your file is that if has Mac Classic newline characters. Apple switched to Unix newline characters back in 2000 when they released Mac OS X 10.0. I don't know why some applications persist in using data formats that Apple's obsoleted 10 years ago, but apparent Readiris is one of those applications.

You need to replace all of the Mac Classic newline characters with Mac OS X newline characters in order for NeoOffice to identify it as a plain text file. I use the following Terminal commands to do that:

Code:
cat "/path/to/source/txt/file" | tr '\r' '\n' > "/path/to/new/txt/file"


Patrick
Back to top
Lorinda
Captain Mifune


Joined: Jun 20, 2006
Posts: 2051
Location: Midwest, USA

PostPosted: Wed Jun 02, 2010 6:49 pm    Post subject:

Thanks, Patrick.

I can't get the Terminal command to work--I must be doing something wrong. That's o.k., though. It looks like I can open this kind of file in Text Edit, then copy and paste into NeoOffice.

It's not something I do often, so it's not a big deal.

Lorinda
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> NeoOffice Releases All times are GMT - 7 Hours
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.