Reply to topic  [ 5 posts ] 
Macro request 
Author Message
User avatar

Joined: 2004-06-28 00:03:01
Posts: 72
Location: Germany
Dear NW Pro community,

I am not skilled enough to write macros, therefore I would appreciate it very much if one could solve the following problem for me.

I have a very large document with sequences in it like

[return]
A[space]B[space]C[tab][text]
[return]
A[space]B[space]C[tab][text]
[return]
A[space]B[space]C[tab][text]
[return]
and so on

A, B, C are single characters, letters or strange glyphs like ʕ,Ṭ, ʔ, Ǧ , Ḏ , Ḏ̣ (which is a combined sign) and suchlike. Not necessaryly there are exact 3 characters between, [return] and [tab], maybe there are only 2 characters or more than 3 characters seperated by a [space], but not more than 9 characters.

I am looking now for 2 macros. The first one should remove all spaces in these sequences between the characters.

The second one should afterwards do the opposite, what means to add spaces in the sequences which are now without spaces.

Thanks for help!


2014-05-07 01:54:58
Profile
User avatar

Joined: 2007-02-07 00:58:12
Posts: 876
Location: Japan
Let me see if I understand your request correctly: The paragraphs in your file start with between 2 and 9 alphabetic characters followed by a tab and some text. You want to add/remove spaces between these alphabetic characters.

This is not really a macro task, but rather a Powerfind Pro task. However the indeterminate number of characters and the need to add/remove spaces for each character do make it a bit tricky. So I guess a macro does work best after all. So try the following and see if they do what you want.

Attachment:
Useeger Add Spaces.nwm [16.22 KiB]
Downloaded 135 times

Attachment:
Useeger Remove Spaces.nwm [16.21 KiB]
Downloaded 138 times

_________________
philip


2014-05-07 05:36:29
Profile
User avatar

Joined: 2004-06-28 00:03:01
Posts: 72
Location: Germany
Dear Philip,

"Remove Spaces" works fast and perfect. Splendid!

"Add Spaces" has a problem with the sign Ḏ̣ which is a combined charakter out of Ḏ and a dot under it. After the execution of the macro the Ḏ̣ is splitted to a Ḏ followed by a space with a dot under it, like Ḏ ̣

If it is difficult to change that, no problem, this can be afterwards easily corrected by a simple find-replace procedure.

Thank you very much!


2014-05-07 06:59:08
Profile
User avatar

Joined: 2007-02-07 00:58:12
Posts: 876
Location: Japan
useeger wrote:
"Add Spaces" has a problem with the sign Ḏ̣ which is a combined charakter out of Ḏ and a dot under it. After the execution of the macro the Ḏ̣ is splitted to a Ḏ followed by a space with a dot under it, like Ḏ ̣

If it is difficult to change that, no problem, this can be afterwards easily corrected by a simple find-replace procedure.

I was going to say that it would be easy to change, but after thinking about it I can't think of an easy way to modify the macro to do this. So the simple find/replace you suggest is probably the best idea. You can also add that simple find/replace as a line to the end of macro.


useeger wrote:
Thank you very much!

Your welcome.

_________________
philip


2014-05-07 08:29:38
Profile
User avatar

Joined: 2004-06-28 00:03:01
Posts: 72
Location: Germany
phspaelti wrote:
You can also add that simple find/replace as a line to the end of macro.


Did it. Now it does exactly what I wanted and saves me a lot of time. Thanks again!


2014-05-07 08:54:49
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: Bing [Bot] and 3 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software