OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

find & replace truncation

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer
View previous topic :: View next topic  
Author Message
pminter
Newbie
Newbie


Joined: 15 Aug 2004
Posts: 4

PostPosted: Sun Sep 19, 2004 9:29 pm    Post subject: find & replace truncation Reply with quote

In doing a "Replace All" function intended to delete all the paragraph marks in a UTF-8 encoded text file using the regular expression "$" I have found that after the 65535th character (i.e. 64K) the file gets truncated. If the file is significantly longer than that the final portion of the file is included, but there is still that missing portion after the 64K limit. I have not found what the parameter might be that determines how much of the end of the file is included, but it goes from some (random?) point all the way to the end.

I thought maybe someone else has had something similar and can tell me how to avoid it - other than splitting my files.

I use OpenOffice.org 1.1.2 running on Windows XP Pro with 512Mb of memory.
Back to top
View user's profile Send private message
Iannz
OOo Advocate
OOo Advocate


Joined: 14 Feb 2004
Posts: 494
Location: Christchurch, New Zealand

PostPosted: Mon Sep 20, 2004 4:54 pm    Post subject: Reply with quote

I would appreciate it if you would test my find & replace macro and let me know if it has the same problem.
The macro is in a document called IannzFindReplace.sxw available from the url in the signature.
_________________
Cheers, Ian

http://wiki.services.openoffice.org/wiki/Extensions_development_basic a wiki about writing OpenOffice.org extensions.
Back to top
View user's profile Send private message
pminter
Newbie
Newbie


Joined: 15 Aug 2004
Posts: 4

PostPosted: Mon Sep 20, 2004 9:34 pm    Post subject: Reply with quote

I tried IannzFindReplace and it appears that, besides being very slow at the replace, it has the same problem. I watched it get to the 64K mark in the file as it was working and from that point to the next paragraph mark was truncated, then it picked up with the replacing from that point on.

I was reading Andrew Pitonyak's Macro Document since I posted originally. He makes a reference to a 64K limit on strings, so that may be what is coming into play here. I just don't know enough about OOo Basic to do anything other than fiddly workarounds like splitting the file.

Paul
Back to top
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Tue Sep 21, 2004 4:14 am    Post subject: Reply with quote

When you delete all paragraph breaks with the regular expression $ you do create one long string and run into the 64K limitation. I worked around it in my macro here but the outcome for a long file is slow macro: http://www.oooforum.org/forum/viewtopic.php?t=6429&highlight=convert+ascii+text
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group