tag:support.multimarkdown.com,2013-02-12:/discussions/problems-v4/1500-pasting-as-table-doesntMultiMarkdown Software, LLC: Discussion 2018-05-01T12:51:39Ztag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-26T18:30:26Z2018-04-26T18:30:26ZPasting as table … doesn't<div><p>Can you send me the excel file you you tried to use and the resulting Composer file you get when pasting?</p>
<p>It works fine for me.</p>
<p>Thanks,</p>
<p>F-</p>
<p>--<br>
Fletcher T. Penney<br>
Manager, Founder<br>
MultiMarkdown Software, LLC<br>
<a href="mailto:admin@multimarkdown.com">admin@multimarkdown.com</a></p></div>Fletchertag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-26T18:50:08Z2018-04-26T18:50:09ZPasting as table … doesn't<div><p>Sure. I'm going to send another reply to this email (you should at least get this if you don't get the other).</p></div>Vince Ricetag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-26T18:58:22Z2018-04-26T18:58:25ZPasting as table … doesn't<div><p>Here you go. I actually re-constructed this on a different computer using a different version of Excel into a different MMD document, with the same results. (I had already closed Excel and didn't save the spreadsheet, I just created it to get the data to copy into MMD.)</p>
<p>In Excel, I highlighted just the area in question (A1 thru F5; I think it should be highlighted when you open it), hit Cmd-C to copy it, then Alt-tabbed over to MMD and selected Paste/Paste as Table from the menu.</p>
<p>Original issue was on an iMac running 10.12.6, Excel 16.12, MMD 4.3.3. This was an MMD document I'd been working on for most of the day.<br>
This one on a MacBook Pro running 10.12.6, Excel 14.7.7 (i.e. Office Mac 2011), MMD 4.3.3. This was a brand new MMD document created just for this purpose; I typed the "This is a test" line, did the paste, and that was it.</p></div>Vince Ricetag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-26T19:29:28Z2018-04-26T19:29:28ZPasting as table … doesn't<div><p>I don't actually have Excel -- when I open your file in LibreOffice and copy the relevant section of the document, it works fine.</p>
<p>Are you only copying the visible portion of the table?</p>
<p>Can you send me a text file when you paste into BBEdit?</p>
<p>I'm out of town, so am limited to what I have installed on my laptop and have limited internet...</p>
<p>F-</p>
<p>--<br>
Fletcher T. Penney<br>
Manager, Founder<br>
MultiMarkdown Software, LLC<br>
<a href="mailto:admin@multimarkdown.com">admin@multimarkdown.com</a></p></div>Fletchertag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-26T19:40:06Z2018-04-26T19:40:08ZPasting as table … doesn't<div class="">
<div class=""></div>
<div class="">
<div class="">
<blockquote type="cite" class=""><span class="">In Ex</span><span class="">cel, I highlighted <i class=""><b class="">just the area in question (A1 thru F5</b></i>; I think it should be highlighted when you open it)</span></blockquote>
</div>
</div>
</div>
<div class=""><br class=""></div>
<div class=""></div>Vince Ricetag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-26T19:58:27Z2018-04-26T19:58:27ZPasting as table … doesn't<div><p>What happens if you copy the text from the BBEdit file and paste that into Composer as a table?</p>
<p>When I do that, it works fine.</p>
<p>F-</p>
<p>--<br>
Fletcher T. Penney<br>
Manager, Founder<br>
MultiMarkdown Software, LLC<br>
<a href="mailto:admin@multimarkdown.com">admin@multimarkdown.com</a></p></div>Fletchertag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-26T20:58:08Z2018-04-26T20:58:10ZPasting as table … doesn't<div><p>Yes, that does work.<br>
But I'm not pasting from BBEdit. :) If I'm pasting as a table, it's going to be coming from Excel. Because it's, you know, tabular. (Not tubular, that's, like, a whole different thing, ya know?)</p>
<p>Aside: Why are the rows (except for the last line) pasted with double-spaces on the end of the line? A table row doesn't need a hard break in any form of MD, including this one. (Deleting the extraneous spaces makes no difference in formatting.)</p>
<p>For completeness, here's an updated version of the test .md file. It contains three sets of pairs of data: data pasted via Cmd-V and via "Paste as table," from Excel, from Numbers, and from Excel to BBEdit to MMD. I did it twice — once with "Use elastic tabstops" checked (which is where I normally have it), once with it unchecked. I've attached pictures of both (since the file itself is the same in both cases, I believe). The file attached was the one with it checked.</p>
<p>Excel pasted normally looks fine, so there's nothing inherently wrong with the data. But it's sure getting messed up in Paste as Table.</p>
<p>With elastic tabs checked.</p>
<p>With elastic tabs unchecked.</p></div>Vince Ricetag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-26T22:41:42Z2018-04-26T22:41:42ZPasting as table … doesn't<div><p>Surprisingly, a Microsoft product seems to be doing something non-standard.... ;) I'll have to try and figure out what Excel is putting on the pasteboard, and why it doesn't match what is expected.</p>
<p>In meantime, you could probably paste from Excel as regular text, then copy/cut, and then re-paste as table. That <em>should</em> provide you with the proper result, albeit with an extra two steps.</p>
<p>Markdown doesn't support tables, so the default formatting for MultiMarkdown tables is to include spaces at the end so that it degrades to something cleaner than a run-on paragraph if it's passed through a MD processor. I do the same thing for metadata for the same reasons. Neither syntax structure <em>requires</em> the line breaks, but including them makes for a slightly "safer" document. (You can turn on the "Limit to Strict Markdown functionality" preference and look at the preview to see what I mean if you care, but can probably imagine it just fine.)</p>
<p>Elastic tabstops don't change the underlying text, merely sets the tab widths for the editor view based on content, rather than a fixed width. So that shouldn't play any role here, except in terms of how the tables (or almost tables) look.</p>
<p>Instead of paste as table, do you see anything strange if you paste as something else (e.g. bulleted/enumerated list or block quote)? They use the same underlying access to the macOS pasteboard, but then process the text differently). If you do see something strange happening, let me know and maybe that will help me identify the issue.</p>
<p>Otherwise, I could create a dummy app that records exactly what gets pasted and would allow me to see exactly what Excel is sending.</p>
<p>Thanks, and as usual you managed to find an interesting problem for me to solve.... ;)</p>
<p>F-</p>
<p>--<br>
Fletcher T. Penney<br>
Manager, Founder<br>
MultiMarkdown Software, LLC<br>
<a href="mailto:admin@multimarkdown.com">admin@multimarkdown.com</a></p></div>Fletchertag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-27T14:51:15Z2018-04-27T14:51:15ZPasting as table … doesn't<div><p>Hah! I just use the product, man, I just use the product. :)</p>
<p>The harsh reality is that they're still the 800-pound gorilla. (They used to be 1500-pound, they're getting smaller.) Whatever they do has to be accounted for. But it pastes correctly when pasting normally, so it can't be that different can it? (Rhetorical, don't answer that. :) )</p>
<p>Re elastic tabs, that's what I thought. (That's why I didn't send two files.) Interesting thing about them, though. Given that they don't impact the file, I would expect toggling the setting off and then back on to put the display back to where it was before. It doesn't. Once it gets messed up from the toggling off, it stays messed up.</p>
<p>This is honestly the first time I've ever "pasted as". I'm rarely pasting anything in an MD document, I'm typing it from scratch. I only did the table because I had already created the spreadsheet to get the numbers, and figured it was easier to paste than re-type it. Boy was I wrong…</p>
<p>Speaking of, you didn't say why there isn't a "Convert to table" menu item. That's what I was actually looking for in the first place.</p>
<p>Do you mean past as something else from Excel specifically? If I get a chance I'll play with it.</p></div>Vince Ricetag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-27T16:03:55Z2018-04-27T16:03:55ZPasting as table … doesn't<div><p>How would you want a convert to table to work? Convert all tabs to pipes? I use something similar when pasting as a table because I "assume" that I'm getting accurate data. Could do the same with selected text and leave it to user to ensure properly formatted data. Or is there a different way you would want it to work?</p>
<p>Yes - if you copy from excel and then paste as list it might give a clue as to what excel is sending composer.</p>
<p>F-</p>
<p>Sent from my iPhone</p></div>Fletchertag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-27T16:20:36Z2018-04-27T16:20:36ZPasting as table … doesn't<div><p>I'm fine with that, i.e. doing essentially the same thing as Paste as Table. I think you have to make some assumptions on any "Convert as", and that's a decent one for a table.</p>
<p>Here's an update to the "Table Test.md" file. I added three things:<br>
The first column from the Excel spreadsheet pasted as bulleted list.<br>
The entire table (A1-F5) pasted as enumerated list.<br>
The actual data (B1-F5) pasted as table rows. I copied the first two rows (header and underscores) from one of the tables above so it would format right.</p>
<p>All of those look like they should. That's looks to me like it's pointing to something in Paste as Table specifically.</p>
<p>Also, on a whim, I copied the table (A1-F5) to a different position in the middle of the spreadsheet, then copied it from there and pasted it as table. Same behavior, so I didn't bother saving it. (I was eliminating the possibility that since pasting from B1-F5 as table rows worked, that maybe it was something with including the first row. I know, insanity, but I've seen stranger things.)</p></div>Vince Ricetag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-27T16:55:45Z2018-04-27T16:55:45ZPasting as table … doesn't<div><p>Hmmmm... Nothing jumps out immediately from the lists....</p>
<p>Though I do see that the last table has a pipe before the <code>10</code> in the first row, but no leading pipes in the subsequent rows. When I paste as table or as table rows, I get leading pipes...</p>
<p>I think I'll have to create that test app to record exactly what Composer is getting from the pasteboard. I'll send you a download link when I do.</p>
<p>Thanks again for helping me troubleshoot this,</p>
<p>F-</p>
<p>--<br>
Fletcher T. Penney<br>
Manager, Founder<br>
MultiMarkdown Software, LLC<br>
<a href="mailto:admin@multimarkdown.com">admin@multimarkdown.com</a></p></div>Fletchertag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-27T17:23:13Z2018-04-27T17:23:13ZPasting as table … doesn't<div><p>Ok -- here is a quick app with a window and text view.</p>
<ol>
<li>
<p>Copy from excel and paste into the textview. It will show you the path to a file that contains only the string that was received.</p>
</li>
<li>
<p>Paste from excel into bbedit. Then copy from BBEdit and paste into the test app. It will created another log file.</p>
</li>
<li>
<p>Send me the two log files and I'll take a look.</p>
</li>
</ol>
<p>The test app uses the same approach to grabbing text from the clipboard that Composer uses for creating tables. So this should tell us if something strange is happening. If not, I'm at a loss....</p></div>Fletchertag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-27T18:47:50Z2018-04-27T18:47:50ZPasting as table … doesn't<div><p>It says I need 10.13. I'm still on Sierra.</p></div>Vince Ricetag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-27T19:43:47Z2018-04-27T19:43:47ZPasting as table … doesn't<div><p>Uggh.. Stupid defaults.</p>
<p>This should run on 10.12.</p></div>Fletchertag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-27T20:48:29Z2018-04-27T20:48:30ZPasting as table … doesn't<div><p>It says it's not from a trusted developer. What do they know I don't know? Why don't they trust you? How do I even know you're you? I'm going to need a copy of your driver's license and SS# and probably a credit card.</p>
<p>Here are three files, one from Excel, from BBEdit (via Excel), and from Numbers. I added to the end of the name how each was created.<br>
Spoiler alert: they're all identical, except that Numbers has more digits of precision in one of the cells.</p></div>Vince Ricetag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-27T21:32:23Z2018-04-27T21:32:23ZPasting as table … doesn't<div><p>OMG..... I am beginning to think that your computer has been cursed by someone for the sole purpose of torturing me.... ;)</p>
<p>I just looked at the code again to make sure I am not missing something obvious... I don't see it.</p>
<p>Time to revisit the seemingly obvious...</p>
<p>To confirm -- you are using Copy/Paste, not drag and drop, right? (Clearly you didn't when using the test app, b/c it would not have worked). (Speaking of, you could try drag/drop into Composer (not test app), to see if it provides different input).</p>
<p>Also, do you have any utility apps running that could modify the pasteboard?</p>
<p>I might have a really old copy of Excel sitting around (circa 15 years ago?) I will see if I can run it still (my guess is no), so I can try to see what's happening that way. Will have to do that next week when I am back home from vacation.</p>
<p>Do the same/similar mistakes happen when you copy/paste different tables from Excel? Or is it just this one particular instance?</p>
<p>Another next step will be to build a custom beta version of Composer for you that logs the text like the test app, but in the actual production use of creating a table.... I don't know what else to do.</p>
<p>(Speaking off, when I work some more this coming week on scrolling, I'll build a test version of that as well. It will be a big change to make without testing for other users besides myself.)</p>
<p>This has become frustrating, but I refuse to let Microsoft beat me!! ;)</p>
<p>F-</p>
<p>--<br>
Fletcher T. Penney<br>
Manager, Founder<br>
MultiMarkdown Software, LLC<br>
<a href="mailto:admin@multimarkdown.com">admin@multimarkdown.com</a></p></div>Fletchertag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-27T22:15:24Z2018-04-27T22:15:26ZPasting as table … doesn't<div><p>So this is the point where you re-read my very detailed problem report, where I answered all of those questions. :)</p>
<p>I am Cmd-C'ing in Excel and Cmd-V'ing in MMD (for regular paste). For "Paste as Table" I'm Ctrl-C'ing in Excel and then in MMD clicking the Edit menu, then Paste, then Paste as table. Drag-and-drop never occurs to me between apps. (I know, I'm a troglodyte.) D&D doesn't work from Excel (either version), anyway; highlighting the table and clicking just starts a new selection.*</p>
<p>And, as I also said in that awesome blossom of a problem report, I've done this on two completely different computers (iMac and MBP) using two completely different versions of Excel (2011 and 2016). What I probably didn't say (maybe it isn't that awesome of a report) was that I re-created the file in Excel both times. (Oops, I just checked, I did say that. Back to awesome.) The only thing in common is the version of the OS and the version of MMD. They're also not running the same set of startup items (there are some overlaps, certainly). To answer your specific question, I have no idea if there are any that would modify the pasteboard. I don't think I do, but one never knows, does one?</p>
<p>So, just for you, I started my MBP in safe mode and did another test; copying (Cmd-C) from Excel and Edit/Paste/Paste as table in MMD. Same screwed up result (I didn't bother saving the MMD file, since you already have an example.)</p>
<p>MS has a one month free trial <a href="https://products.office.com/en-us/try">https://products.office.com/en-us/try</a> for Office 365, so you can get the current version free for a month if you want to troubleshoot it that way. But I'll be glad to run a debug version of MMD.</p>
<p>On a cost per hour basis, I think this might be the most expensive application I've ever used.<br>
Of course, on a cost per hour basis, I'm the most expensive customer you've ever had.<br>
Which one of us is going to give up first? I'm pretty stubborn… lol</p>
<p>Stop working on this while you're on vacation. When you said you were out of town I thought you were on a business trip.</p>
<p>*I thought that was weird, so I duck'ed it. Turns out you have to put your cursor exactly on one of the edges, and the cursor then turns into a hand that lets it be dragged. The results are worse — dragging it into MMD, every tab is turned into a newline, so it looks like this. This is why I don't use drag-and-drop. (That's not why. I don't use it because I'm a troglodyte.)</p></div>Vince Ricetag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-27T22:54:42Z2018-04-27T22:54:42ZPasting as table … doesn't<div><p>Hopefully the app has also saved you a lot of time as well as costing you a lot. ;)</p>
<p>And yes - you probably win the award for taking the most time on my end, but conversely the app is much better for the things I've fixed based on your feedback.</p>
<p>If I can do a trial of excel that is much better. It allows me to do more testing and does not require more of your time. If I could have recreated this issue I would much prefer to test and fix it myself without bothering someone else. But sometimes that is not possible. Kind of like my day job as a doctor - sometimes I have to get the history from the patient. Sometimes from the family. But some things can't be solved without a good history, no matter how smart the doctor is.</p>
<p>But I've also learned that sometimes to you have to ask the same questions again to be sure you're getting the right answer, no matter how smart the patient is.... ;)</p>
<p>I don't mind dealing with emergencies on vacation. And while not an emergency anymore, this has piqued my interest.</p>
<p>F</p>
<p>Sent from my iPhone</p></div>Fletchertag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-27T23:27:44Z2018-04-27T23:27:44ZPasting as table … doesn't<div><p>If you're going to take me seriously this isn't going to be nearly as much fun.<br>
I was joking, just joking. I think it's funny we keep ending up (temporarily) stymied by weird behavior.</p>
<p>I have no doubt you will be much more productive if I'm not involved. :) But, I'll be glad to run a debug version (or test a new version) when/if the time comes.<br>
Note that the trial is for all of Office, not just Excel, and unfortunately it insists on installing everything. I know, I don't like it, either. (I don't use Powerpoint or Outlook and I don't want them on my computer. Too bad, says MS. Oh, and it phones home constantly. If you don't already run something like Little Snitch, you should think about it. Not because of Office, because that behavior is the norm these days.)</p>
<p>And no one said the patient was smart. Awesome, yes, smart, no. (OK, maybe not awesome, either.)<br>
This is why I (think I) tend to over-provide information; I've been on your side of a problem too many times and I'm always terrified I'm going to miss something obvious.</p>
<p>This is definitely not an emergency. The emergency is where the heck is the iOS version? (See first sentence above.)</p></div>Vince Ricetag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-28T12:51:48Z2018-04-28T12:51:48ZPasting as table … doesn't<div><p>I know you are mostly joking. Just wanted to emphasize that (and I think by now you know) that I take my software seriously, at least in certain respects. I don't like it when it's broken, and I especially don't like it when customers lose their data or waste their time. Given your willingness in the past to help me track things down, I think that at least part of you is intrigued by the weird edge cases that keep turning up... ;)</p>
<p>Here is a beta version of Composer (basically same as latest release, except that when you "paste as table", it creates 2 log files -- one is the text string it receives, and the the next is the table it creates. So if you will copy from Excel, and then paste as table, and then send the two log files. For the moment, I don't need any other tests (e.g. BBEdit, etc.) A "positive" test will be that the second log file will have a messed up looking table. (There are no messages in this version, the 2 files just appear in your home folder).</p>
<p>And yes, I do still have an iOS version in development, but for a variety of non-technical reasons it is on hold (real life keeps moving on even if that means software development doesn't.....). I hope to get back to it soon if only people would stop bugging me about flaws in the Mac version..... ;)</p>
<p>The test build works on my machine, and hopefully it works on yours, but if you get an error let me know what it is and I can recompile. Also, some features are disabled, and I don't recommend using this build for real work.</p></div>Fletchertag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-28T17:35:03Z2018-04-28T17:35:05ZPasting as table … doesn't<div><p>Right. This was my point — you don't have to defend yourself. First, because I was joking, and second, I'm obviously well aware by now that you want things to work correctly. :)</p>
<p>And, yes, I am equally obviously always intrigued by these things. :)</p>
<p>Here you go. It was a "positive" test.<br>
The first thing I see is that the "normal" file is delimited by carriage returns instead of line feeds. I'm assuming/guessing that's the problem? Pasting normally manages to handle it, but as table doesn't?<br>
I did it twice just to make sure. (Results were the same, so I'm only sending the first pair of files.)</p></div>Vince Ricetag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-28T18:07:06Z2018-04-28T18:07:06ZPasting as table … doesn't<div><p>Thank goodness there was a difference. I had no idea what to do next if there wasn't....<br>
;)</p>
<p>I should have figured it was a line ending issue. Shame that Microsoft still has not figured line endings out after so many decades.... Interestingly, they don't seem to make the mistake I would have expected (using Windows line endings), but instead using the wrong kind of Mac line endings (<code>\r</code> instead of <code>\n</code>, which was the line ending format used in the pre-OS X days. So they're only 17 years behind the times....)</p>
<p>Short version -- Composer normalizes line endings every time it opens a file, and saves files using the line endings specified in preferences. Apparently pasting the Excel text as is fixes the line endings. But the paste as table acts on the raw string before any changes are made. That is why pasting alone, and pasting/copying/paste as table, both work.</p>
<p>Attached is a new beta version that <em>should</em> fix the line endings before processing the table. Interestingly, the programs I use to copy the "wrong" text must fix it before pasting, so I can't actually replicate the problem without jumping through some major hoops.... ;)</p>
<p>Hopefully this works for you, and will be included in the next release.</p>
<p>Thanks again for your help!!!</p>
<p>F-</p></div>Fletchertag:support.multimarkdown.com,2013-02-12:Comment/451780562018-04-28T18:40:01Z2018-04-28T18:40:02ZPasting as table … doesn't<div><p>Yes to all the MS stuff.</p>
<p>Yes to the beta working (pause for celebration). Just a couple of niggles (that have, I assume, nothing to do with this problem).<br>
The last line doesn't have a hard break, i.e. the two trailing spaces. The cursor is left immediately following the last pipe on the last line.<br>
The last line is using space before that last pipe instead of a tab. In the picture, what's between "miles" and that last pipe are two spaces instead of a tab. The rest of the table is formatted with tabs.</p>
<p>From Excel in the new beta:</p>
<p>Hmmm. I just copied a "normal" copy of the text (just the tab-delimited text, not the formatted-as-a-table text) from "Table test.md" and pasted it as a table. Interestingly, it still used spaces following the "miles", but it used three spaces after, so it lined up. And if you look at the "Table test.md" file, the data pasted as table from Numbers uses a tab following "miles", as does the data pasted from BBEdit. So, in summary:<br>
"Pasted as table" from Numbers and from BBedit "works" in that tabs are used throughout, including the final one. "Pasted as table" from Excel (with the new logic) has tabs except for the final one, where it uses two spaces. "Pasted as table" from MMD itself (the data is tab-delimited in the file; you have it, so you can see for yourself), when the selection stops immediately after the "s" in miles (IOW, the entire last line isn't selected), has tabs except for the final one, where it uses three spaces. "Pasted as table" from MMD itself, when the selection includes the entire last line, has tabs throughout, as well as the final hard break.</p>
<p>And, you obviously know this, but to state the obvious — we have control over what we highlight when we're highlighting from a text editor (although I would argue "Paste as table" should behave the same regardless), but we don't when copying from Excel (or Numbers, but pasting from Numbers does the right thing).</p>
<p>In short, IMO, "Paste as table" should always look like the very last example below, i.e. with tabs throughout including the final one between the last cell and the last pipe, and with a hard break on the final line.</p>
<p>From MMD, copying only through the last character:</p>
<p>Turns into this table (what follows "miles" are spaces, not a tab):</p>
<p>From MMD, copying the entire last line:</p>
<p>Turns into this table:</p></div>Vince Ricetag:support.multimarkdown.com,2013-02-12:Comment/451780562018-05-01T12:51:39Z2018-05-01T12:51:39ZPasting as table … doesn't<div><p>I posted a 4.4 beta release that should fix the major issue with copying from Excel, as well as a few other things. Once it's been tested, it will be pushed out for general use:</p>
<p><a href="http://support.multimarkdown.com/discussions/betas/384-composer-44-beta">http://support.multimarkdown.com/discussions/betas/384-composer-44-...</a></p></div>Fletcher