OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Text Editor For Pdax With Complex Search?, want to clean up text files
kahm
post Jan 8 2007, 12:08 PM
Post #1





Group: Members
Posts: 657
Joined: 29-September 04
Member No.: 4,809



I've got a whole bunch of text files from around the web, and they have various symptoms of format nastyness. I've decided to spend my bus ride time sorting them out.

A lot of these files are text files with hard returns every ~80 characters. On a desktop I'd use something like Word to search out double returns and replace them with a marker, then replace all the remaining returns with spaces, then replace the markers with double returns.

On my 3100, I can do that with Textmaker. On my 3000, with pdaXii13, I tried to do that with Abiword - but Abiword's search function doesn't support any special or formatting characters whatsoever - It's basically on the same level as Notepad! I'm getting tired of toting 2 Z's everywhere I go, so I'm hoping to find a solution under pdaXrom.

Anyone have any ideas? I'm trying to prep these files so that I can read them on my Librie ebook reader.
Go to the top of the page
 
+Quote Post
InSearchOf
post Jan 8 2007, 12:30 PM
Post #2





Group: Admin
Posts: 1,210
Joined: 20-January 06
From: York, Pennsylvania
Member No.: 8,961



Well... a from a geek level you can use vi...

:s/*orig*/*replace/


I think that is what it is... google "search replace vi" and you will get good results...

Late
Go to the top of the page
 
+Quote Post
Drake01
post Jan 8 2007, 03:40 PM
Post #3





Group: Members
Posts: 226
Joined: 29-March 06
Member No.: 9,483



I thought I saw nedit compiled for PdaXrom. nedit supports regular expression search and replace. It's very competent and fast running on a desktop... probably a little slower on a Z, but it should do what you want.
Go to the top of the page
 
+Quote Post
cvmiller
post Jan 9 2007, 07:01 PM
Post #4





Group: Members
Posts: 242
Joined: 31-March 04
Member No.: 2,592



QUOTE(Drake01 @ Jan 8 2007, 03:40 PM)
I thought I saw nedit compiled for PdaXrom.  nedit supports regular expression search and replace.  It's very competent and fast running on a desktop... probably a little slower on a Z, but it should do what you want.
*


Nedit is pretty slick, I even use it in Xqt (don't have PDAX, sorry). But if you have a bunch of files, you might try sed and a short bash script. Using the sed command with something like
sed -e 's/\n//g' filename > new_filename

Or you could put that into a bash loop like this:
CODE
for f in *.txt
{
sed  -e 's/\n//g' $f >  ${f%%.txt}.text
}

That would rip out all the returns in every txt file in the directory, creating a new set of files ending in text. Once you are happy with the conversion, you can delete all the txt files.

Hope this helps,

Craig...
Go to the top of the page
 
+Quote Post
kahm
post Jan 10 2007, 11:44 PM
Post #5





Group: Members
Posts: 657
Joined: 29-September 04
Member No.: 4,809



Heh! Just the sort of answer I should have expected. smile.gif I'll probably end up resorting to scripting something, just because Abiword performs so much better than Textmaker does. I can work around the only other niggles I have with Abiword.

I'll look up nedit though. I'm getting old enough that I'll take the easy way out if I can smile.gif That, and my regular expressions were never that good to begin with...
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th August 2014 - 10:33 AM