Suggestions for advanced text list editing app?

Joined
Oct 30, 2007
Messages
71
Reaction score
1
Points
8
I was hoping that somebody could recommend a good advanced text list editing application, that I could use to edit a massive text list that I have, in which there is both a leading space and a trailing space at the beginning and end of every item in my text list, which I am trying to get rid of.

Normally, I would use Microsoft Word's Find/Replace feature to replace a particular text character with a different character of my choosing, however, if I were to try and use this feature to remove every space in my document, it would also mess things up quite a bit by removing spaces that exist correctly between the words for various items in my text list.

Does anyone know how I could go about accomplishing this task?

Any suggestions would be greatly appreciated... Thanks!
 
Joined
Apr 29, 2006
Messages
4,576
Reaction score
378
Points
83
Location
St. Somewhere
Your Mac's Specs
Mac Studio, M1 Max, 32 GB RAM, 2 TB SSD
Hi m021478, how massive is massive? If it is not gigabytes in size, and is pure text, I would recommend my own VE text editor. VE is a Terminal.app text editor in the mode of vi, but much, much friendlier and easier to use. It has a set of column commands (the same sort of thing is also available in other advanced text editors such as emacs, and is known as rectangle commands in these editors) which can do this very thing: delete a leading space at the start of each line, or each entry, and also delete a trailing space at the end of each line or entry. You can get the Mac version of VE here.

In some cases, if the file has a regular format, the column commands will do the trick. In cases where each line is of differing indentation and size, a combination of the Find and Replace commands can do the job.

In the worst case, you can create a simple interactive macro that will do the trick as well.

If this is a "one of" (yes, I REALLY do mean "one of", not "one off", which is an abomination), I would be willing to do the job for you. PM me if this is the case and we can arrange to transfer the file to me. I can do the work and transfer it back.
 
Joined
Mar 30, 2004
Messages
4,744
Reaction score
381
Points
83
Location
USA
Your Mac's Specs
12" Apple PowerBook G4 (1.5GHz)
Am I correct in assuming that each item in the list is on it's own line, with the leading and trailing spaces?

Using TextWrangler, it would be pretty easy...do a find-and-replace to substitue " \r " (space + return-sequence + space) with "\r" (return-sequence)

You could probably do the same thing with Word's find-and-replace; just carefully select a space-linebreak-space combination, copy it to the clipboard, and paste it into the find field, and then paste a linebreak by itself into the replace field.

TextWrangler, though, is much less temperamental than Word about such things.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top