is it possible to easily convert tables to text?
is it possible to easily convert tables to text?
Hello,
I've read with interest about the time lag problems with leopard--I'm using an older G4 at 1ghz, NWP (1.0.3), and 10.5.2 now. I'm dealing with an 88-page document that uses a large number of tables with very little other text (1-4 tables per page). Without NWP already running, it takes almost four minutes to open the app itself and this document.
It's a multi-lesson textbook, and I think the author used tables to more conveniently import text that he'd been organizing in Excel (instructional dialogs, exercises, and vocabulary lists). He may also have seen tables as a way to provide formating.
But for my purposes (the book as it now stands) I don't need the tables, and I think that as a table-less text file it would load faster, and it would also be easier to deal with in other ways*. I'd be willing to work thru this document to delete them if it's not too hard. Many of the tables share the same formating so I think that could be preserved/redone with barely a handful of rulers--IF that's that way to go. I've browsed the manual and of course do see how to delete an entire table, but I would like to preserve the text contained in each one. Suggestions? Or can I somehow copy the text without the tables and paste that into a new document? (I've tried this and still get tables, whether I choose Use Existing Styles or not.)
*Even just some simple experimenting with edits to this document sends me into the twilight zone of the spinning pizza wheel...!
tia,
John D.
I've read with interest about the time lag problems with leopard--I'm using an older G4 at 1ghz, NWP (1.0.3), and 10.5.2 now. I'm dealing with an 88-page document that uses a large number of tables with very little other text (1-4 tables per page). Without NWP already running, it takes almost four minutes to open the app itself and this document.
It's a multi-lesson textbook, and I think the author used tables to more conveniently import text that he'd been organizing in Excel (instructional dialogs, exercises, and vocabulary lists). He may also have seen tables as a way to provide formating.
But for my purposes (the book as it now stands) I don't need the tables, and I think that as a table-less text file it would load faster, and it would also be easier to deal with in other ways*. I'd be willing to work thru this document to delete them if it's not too hard. Many of the tables share the same formating so I think that could be preserved/redone with barely a handful of rulers--IF that's that way to go. I've browsed the manual and of course do see how to delete an entire table, but I would like to preserve the text contained in each one. Suggestions? Or can I somehow copy the text without the tables and paste that into a new document? (I've tried this and still get tables, whether I choose Use Existing Styles or not.)
*Even just some simple experimenting with edits to this document sends me into the twilight zone of the spinning pizza wheel...!
tia,
John D.
- martin
- Official Nisus Person
- Posts: 5230
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
If you want to convert all tables in a document to text, you can use this macro:
Code: Select all
#move to start of document
Set Selection 1, 0
# convert all tables
While Select Next Table
Copy Table Text
Delete
Paste
End
Martin,
Thanks a lot for that macro, tho I'll have to approach that carefully--I'm even less 'fluent' in macros than I am in tables.
Still, this would be a great and very practical place to start. I think I'll pass a link to this thread on to the author of the textbook, who apparently has a background in databases, and try to work together on it.
many thanks again,
John D.
PS--there's a macbook pro on the (distant) horizon, so maybe the speed thing will kind of solve itself.
Thanks a lot for that macro, tho I'll have to approach that carefully--I'm even less 'fluent' in macros than I am in tables.
Still, this would be a great and very practical place to start. I think I'll pass a link to this thread on to the author of the textbook, who apparently has a background in databases, and try to work together on it.
many thanks again,
John D.
PS--there's a macbook pro on the (distant) horizon, so maybe the speed thing will kind of solve itself.
The Copy Table Text command will work across multiple tables. I even tried it on multiple tables separated by chunks of text. I used the non-contiguous selection feature (which I love in NWP) and then when all of the tables were highlighted, the Copy Table Text command worked exactly as it had on a single table.
This might be an alternative if the macro approach seems a bit daunting.
This might be an alternative if the macro approach seems a bit daunting.
follow-up
Martin (and ProfT)
The macro that Martin provided seems to have worked. It took several minutes--it seemed to go thru the file in steps--and tho I haven't looked thru the end result to see if anything unplanned happened along the way, it generally looks like I expected it to.
And the opening speed is hugely different. The revised, table-less file opens in a little over 10 seconds (NWP 1.0.3; OS 10.5.2, on a 1ghz powerbook with only 768mb of RAM). And it may be a little faster on a second powerbook I use, 1.5gb of ram and a 1.67ghz cpu.
Now to set up a few rulers! Page-to-page formating is very consistent, I think I might be able to get away with five.
Thanks again, folks!
John D.
The macro that Martin provided seems to have worked. It took several minutes--it seemed to go thru the file in steps--and tho I haven't looked thru the end result to see if anything unplanned happened along the way, it generally looks like I expected it to.
And the opening speed is hugely different. The revised, table-less file opens in a little over 10 seconds (NWP 1.0.3; OS 10.5.2, on a 1ghz powerbook with only 768mb of RAM). And it may be a little faster on a second powerbook I use, 1.5gb of ram and a 1.67ghz cpu.
Now to set up a few rulers! Page-to-page formating is very consistent, I think I might be able to get away with five.
Thanks again, folks!
John D.
-
- Posts: 50
- Joined: 2013-02-03 05:10:26
Re:
What if I only want to convert the table in which I've either selected some text (or clicked in) to text and then have the table removed, as Pages' "Convert Table to Text" does? How would the above macro need to be changed?martin wrote:If you want to convert all tables in a document to text, you can use this macro:
Code: Select all
#move to start of document Set Selection 1, 0 # convert all tables While Select Next Table Copy Table Text Delete Paste End
Howard
P.S. I've asked my question here rather than in the macro forum as this forum was where the original post was.
-
- Official Nisus Person
- Posts: 428
- Joined: 2003-02-11 10:49:05
- Location: Solana Beach, CA
- Contact:
Re: is it possible to easily convert tables to text?
Howard,
In that case all you need do is choose the menu command Table > Copy Table Text, delete the table and then paste in the contents of the Clipboard.What if I only want to convert the table in which I've either selected some text (or clicked in) to text and then have the table removed, as Pages' "Convert Table to Text" does? How would the above macro need to be changed?
Write On!
Mark Hurvitz
Nisus Software Inc.
Mark Hurvitz
Nisus Software Inc.
-
- Posts: 50
- Joined: 2013-02-03 05:10:26
Re: is it possible to easily convert tables to text?
I've tried that; however, when I click in a table, execute Table > Copy Table Text, and then click Paste outside the table, nothing gets pasted.rmark wrote:Howard,In that case all you need do is choose the menu command Table > Copy Table Text, delete the table and then paste in the contents of the Clipboard.What if I only want to convert the table in which I've either selected some text (or clicked in) to text and then have the table removed, as Pages' "Convert Table to Text" does? How would the above macro need to be changed?
This is the table whose contents I tried to copy shown after I've clicked in it:
Re: is it possible to easily convert tables to text?
You have to *select* the table (not just click inside it) for Copy Table Text to have any effect 

philip
- martin
- Official Nisus Person
- Posts: 5230
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: is it possible to easily convert tables to text?
That's exactly right, and that can be done using either the mouse or the menu Table > Select > Table, which expands any selection in a table to encompass the whole table.phspaelti wrote:You have to *select* the table (not just click inside it) for Copy Table Text to have any effect
Re: is it possible to easily convert tables to text?
And I just noticed that Table > Select > Table works correctly across multiple tables. (I have always been using Select All (twice) to select tables, but that only works on a single table.)
philip