Make text into table

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Tobias Escher
Posts: 202
Joined: Mon Dec 28, 2015 7:32 pm

Re: Make text into table

Unread post by Tobias Escher »

Hi Martin,

yes, all tables begin with 00. or 01.

Yes, a box for the table style would be awesome!
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Make text into table

Unread post by Martin Wynne »

Hi Tobias,

The lines immediately preceding and following each table are not consistent.

Are there any blank lines in any of the tables? As far as I can see the only way to find the end of a table reliably is to wait for the numeric count to fail. A blank line in a table would therefore terminate that table.

regards,

Martin.
Tobias Escher
Posts: 202
Joined: Mon Dec 28, 2015 7:32 pm

Re: Make text into table

Unread post by Tobias Escher »

No, the tables have no blank lines.
However the tables do not necessarily end with a number.
So the last row might not have XX. whatever

Basically the rule is: A table always starts with a number and goes on until an empty line comes. Also within a table there is never any other text style but Body Text.
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Make text into table

Unread post by Martin Wynne »

Tobias Escher wrote:Basically the rule is: A table always starts with a number and goes on until an empty line comes.
Your empty lines are not consistent and do not contain anything unique. However, none of them contain any text. Providing they are all like that, and you have not typed so much as a single space in any of them, I can use the lack of text to terminate the table.

regards,

Martin.
Tobias Escher
Posts: 202
Joined: Mon Dec 28, 2015 7:32 pm

Re: Make text into table

Unread post by Tobias Escher »

Yes, that should work. If there's an empty line the table has ended.
the empty lines probably sometimes have different paragraph styles associated, I guess. They look the same here, but I can see that some are simply line breaks while others are new paragraphs. I have no idea where that came from, I just pasted text from .txt files I received.
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Make text into table

Unread post by Martin Wynne »

Tobias Escher wrote:Yes, that should work. If there's an empty line the table has ended.
the empty lines probably sometimes have different paragraph styles associated, I guess. They look the same here, but I can see that some are simply line breaks while others are new paragraphs. I have no idea where that came from, I just pasted text from .txt files I received.
This is getting confusing. Do you mean that some tables are terminated by a line break rather than a new paragraph?

Martin.
Tobias Escher
Posts: 202
Joined: Mon Dec 28, 2015 7:32 pm

Re: Make text into table

Unread post by Tobias Escher »

In some topics it looks to me like it.
H+M at the end of the text shows a line break into an empty new line instead of a new paragraph. I just copied and pasted, so that line break must have been part of the original txt.
Below is how this looks. It seems to be only in a single topic, so I can easily skip it. I will make sure there are no line breaks like this before using your application!
<para styleclass="Heading3"><text styleclass="Heading3" translate="true">District I - Orchestra</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Non-TOC Headline" translate="true">Finkenstein Strings (High)</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">01. Strings High Legato 8va</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">02. Strings High Sustains 8va</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">03. Strings High Sustains Unison</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">04. Strings High Tremolo Unison</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">05. Strings High Spiccato 8va</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">06. Strings High Spiccato Unison</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">07. Strings High Spiccato Blurred 8va</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">08. Strings High Portato Long Unison</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">09. Strings High Portato Short Unison</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">10. Strings High Bartok Pizzicato Col Legno 8va</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">11. Strings High Crescendo Long Unison</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">12. Strings High Crescendo Short Unison</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">13. Strings High Swell Unison</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">14. Strings High Tremolo Decrescendo Unison</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">15. Strings High Glissandi Up 8va</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">16. Strings High Glissandi Cluster 8va</text></para>
<para styleclass="Non-TOC Headline"><br/><text styleclass="Non-TOC Headline" translate="true">Wolfenstein Strings (Low)</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">01. Strings Low Legato 8va</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">02. Strings Low Sustains 8va</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">03. Strings Low Tremolo 8va</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">04. Strings Low Spiccato 8va</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">05. Strings Low Portato Long 8va</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">06. Strings Low Portato Short 8va</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">07. Strings Low Bartok Pizzicato Col Legno 8va</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">08. Strings Low Crescendo Long 8va</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">09. Strings Low Crescendo Short 8va</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">10. Strings Low Swell 8va</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">11. Strings Low Tremolo Decrescendo 8va</text></para>
<para styleclass="Non-TOC Headline"><text styleclass="Body Text" translate="true">12. Strings Low Glissandi 8va</text></para>
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Make text into table

Unread post by Martin Wynne »

Are there any <br/> line breaks anywhere else in the tables? If not I can use that as a table terminator in addition to the empty lines.

Martin.
Tobias Escher
Posts: 202
Joined: Mon Dec 28, 2015 7:32 pm

Re: Make text into table

Unread post by Tobias Escher »

No, within the tables there are no line breaks at all as far I can see.
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Make text into table

Unread post by Martin Wynne »

Hi Tobias,

Here's a first trial of the conversion utility, link below.

It has proved extremely difficult to test without your actual files. So please try this and report any problems.

Note that the 00 or 01 must not have any preceding spaces, and must be followed by a dot. The strings 00 and 01 occur in numerous places in most files in various style parameters and file headers, so this restriction is necessary. The actual search string is ">00." or ">01." which I can't imagine occurring anywhere else.

This is scruff software written quickly for one specific task. There is no error checking or idiot-proofing at all. So it will work only if the instructions are followed to the letter without any typos or mistakes:

MAKE A BACKUP OF YOUR PROJECT FIRST.

1. create a folder somewhere on your computer. If you need to transfer files between computers it would be handy to put it on a USB stick. It doesn't matter what the folder is called. But don't put it in those infuriating Windows virtual folders (My Documents, etc.) or anywhere near C:\Program Files\ . Just create your own folder somewhere such as F:\HM_TEXT_CONVERT\ .

2. download this exe file and save it in that folder: http://mystourport.uk/text2table.exe

3. in that folder create 2 sub-folders, named INPUT and OUTPUT.

4. copy and paste your XML topic files into the INPUT folder. As many as you like in one go, but it would make sense to try just a few first. They won't be modified, so if it all goes wrong you can copy them back.

5. leave the OUTPUT folder empty.

6. run the downloaded file:
text2table.png
It is unsigned so you will need to click through the warnings.

7. set the vertical alignment and table style as required. Obviously if you don't use the Default style you will need to create the style in H&M first. Note that it is case sensitive and must be entered exactly as shown in the H&M Edit Styles dialog.

8. click the GO button.

9. the program will convert the files, and report the number of files processed (whether they contained any text to table conversions or not).

10. the converted files will be in the OUTPUT folder, with the same names, from where you can copy and paste them back into your H&M project.

I shall be surprised if it works perfectly first time, but who knows. :)

regards,

Martin.
You do not have the required permissions to view the files attached to this post.
Tobias Escher
Posts: 202
Joined: Mon Dec 28, 2015 7:32 pm

Re: Make text into table

Unread post by Tobias Escher »

Hi Martin,
wow - totally awesome! It works PERFECTLY on ALL topics.

May I voice two feature requests that would make this useful for other applications, too:
- The ability to have the Body Text (= the content of the table) become another style when the table is created. Ideally with a text box to input the style just like with the table style (which by the way works fabulous)
- To have the actual table content begin in line 2. I totally forgot that the head row is part of the table so now 01. is entered in the head row. If it were possible to enter values for the Head row upon table creation that would be even more awesome, but just leaving the head row free would be enough already.

Wow, this is so awesome! You should make a "H+M Toolbox" with little apps like that.
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Make text into table

Unread post by Martin Wynne »

Hi Tobias,

Thanks for the feedback. I'm glad it worked ok first time -- if a bit surprised. :)
May I voice two feature requests that would make this useful for other applications, too:
- The ability to have the Body Text (= the content of the table) become another style when the table is created. Ideally with a text box to input the style just like with the table style (which by the way works fabulous)
All things are possible. But of course something which took an hour or two to write and test, rapidly becomes a major project. In this particular case it would need a paragraph style and a text style, which could be different. (They have always been entirely separate in the RVF editor and I never really understood why H&M links them together, although Tim and Alexander explained it several times.)
To have the actual table content begin in line 2. I totally forgot that the head row is part of the table so now 01. is entered in the head row. If it were possible to enter values for the Head row upon table creation that would be even more awesome, but just leaving the head row free would be enough already.
I read that twice and it's still not clear. Perhaps a screenshot would help. :?

The most obvious thing is for you to enter a marker string at the start of the table. Something like @@@. I can then delete that and start the first row of the table with whatever comes next. This would then be useful for others -- I doubt many other users have tables which begin 00.
You should make a "H+M Toolbox" with little apps like that.
Little apps I can do. I have in fact posted a few in the past on here. What I can't do is add layers of idiot-proofing and provide support when users get in a muddle or make mistakes. I just don't have time for all that -- I spend much of my time already supporting my own software. Tim is amazing in the way he has retained his sanity after all these years doing H&M support. :)

regards,

Martin.
Simon Dismore
Posts: 454
Joined: Thu Nov 16, 2006 1:29 pm
Location: London, UK

Re: Make text into table

Unread post by Simon Dismore »

Martin Wynne wrote:Tim is amazing in the way he has retained his sanity after all these years doing H&M support. :)
+1 for that sentiment :applaud:
Tobias Escher
Posts: 202
Joined: Mon Dec 28, 2015 7:32 pm

Re: Make text into table

Unread post by Tobias Escher »

Absolutely - if I were Tim I'd have gone mental. I'm doing all support at our company and even with the few emails I have to deal with sometimes I want tohit my head very hard against a solid surface.

Martin: Attached are two screenshots. table.png shows how it looks after the transformation. The first table item is inserted in the head row.
The second PNG shows how I need it at the end. The head row has "Articulation" and "Properties" and the actual content starts in the next line. If your software could create the names for these head row columns automatically via user input, that would be awesome. if not, it could simply leave the first row (= heas row) of the table empty so the user can fill in the names.

I am still amazed at how well that software works...
You do not have the required permissions to view the files attached to this post.
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Make text into table

Unread post by Martin Wynne »

Tobias Escher wrote:If your software could create the names for these head row columns automatically via user input, that would be awesome. if not, it could simply leave the first row (= head row) of the table empty so the user can fill in the names.
Hi Tobias,

But you said you have hundreds of tables. You surely don't want the program to stop and ask for some user input hundreds of times?

Or do you mean you want the same heading row on every table? That or an empty row is easy.

Alternatively do you mean that you want the preceding heading line to be duplicated in the first row of the table?

Setting a head row colour is part of the table styles. It can be done directly in the XML for each table but I fear that might produce conflicting results.

regards,

Martin.
Post Reply