Ask Your Question
0

paste csv doesn't work in calc

asked 2020-06-26 07:40:11 +0200

Johan_Ha gravatar image

I have this text, which I've copied from Inkscape:

m 29.93354,122.03962 c 60.795248,9.74581 37.706974,102.679 64.15987,55.92235 26.45289,-46.75665 67.98858,-37.70698 35.38655,-31.3258

I click on a cell in Calc. I press ctrl + shift + v. I choose unformatted text (the only available). Expected behaviour: I'd get the window where I can choose what character to use as a separator (among other stuff). What happens: The whole text junk gets pasted into the marked cell.

There's something strange in the text that seems to activate a bug in Calc. I can paste the text to some text editor (Notepad++, Arduino IDE etc), do this and that to the text and copy-paste it again and suddenly it works. But I can't reproduce the procedure. It's like Calc recognises this as text that simply cannot contain anything of interest that could be comma separated and decides to skip the step where I get to decide the separator character.

I had version 4.* before and thought this was an old bug I updated to 6.3.6.2 (x64), but it behaves exactly the same. What am I missing here?

edit retag flag offensive close merge delete

Comments

Just a workaround for this 1-line text: after pasted, use DataText to Columns on it.

Mike Kaganski gravatar imageMike Kaganski ( 2020-06-26 07:58:52 +0200 )edit

You'd better share a sample file rather than pasting its contents here.

gabix gravatar imagegabix ( 2020-06-26 08:46:59 +0200 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2020-06-27 13:19:18 +0200

Johan_Ha gravatar image

Ok. The data->text to columns really works good enough!

So, to be clear. If I paste several lines into one cell and choose unformatted text, it brings up the CSV import window. But if I paste a single line, it doesn't, and it shouldn't. If there's a good reason for that, I'm good with it. I just don't see the reason.

edit flag offensive delete link more

Comments

The reason is that users are annoyed by a dialog popping up when all they want is to special-paste a piece of text.

erAck gravatar imageerAck ( 2020-06-27 17:33:03 +0200 )edit
0

answered 2020-06-26 08:53:53 +0200

lua gravatar image

updated 2020-06-27 08:14:24 +0200

Hi, I don't know why but, I had to save your code on a xx.txt file, open the xx.txt in calc to obtain the paste special option needed. After closing everything and retry simply passing the code without going by the xx.txt file, it goes as initially planed. I hope that goes the same for you


Episode 2 new session back to initial situation. Just a little precision about Mike Kaganski solution, you must paste your line in calc first (it will be a single cell) then re-select this cell to have access to the Data>Text to Columns menu

edit flag offensive delete link more

Comments

Yes, I have a workaround for this. But it is really annoying why Calc, while doing ctrl+shift+v, doesn't go into the window where I can select the separator character for pasting a csv style text chunk I have in the clipboard.

Johan_Ha gravatar imageJohan_Ha ( 2020-06-26 09:25:51 +0200 )edit

I don't think that pasting a single line of text, Calc should bring the CSV import window. Pasting a single line into a single cell is a widespread scenario. Using the tool I mentioned in the comment to question - DataText to Columns - does the same, with just one additional step, while providing another paste option would still require the additional step to select the option.

Mike Kaganski gravatar imageMike Kaganski ( 2020-06-26 16:07:50 +0200 )edit

@Mike Kaganski: Calc might distinguish whether or not the single line of text is terminated by something used for <br> or </p> like ASCII 13 (10? 10 // 13? 13 // 10? - a mess again).
If not, the clipboard content may be taken as just a part (up to 100%) of a line, and get pasted into a single cell. Otherwise it may be taken as a singleton needing to be treated as a one-element-array of lines (like contents from csv then).
However, I don't even know if the clipoard actually always takes the terminating mark if selected somewhere by the user before copying to the clipboard.
Calc seems to only accepts the full-line-assurance by the included break mark (if passed?) if there also is at least one additional character, and thus a two-elements-array of lines

Lupp gravatar imageLupp ( 2020-06-27 10:37:04 +0200 )edit

After a few more experiments I now suspect Calc to be the culprit: It ignores the trailing break while different text-accepting applications regard it.

Lupp gravatar imageLupp ( 2020-06-27 11:39:22 +0200 )edit

It does that on purpose if it is only one line of text. Users often copy one entire line including a newline and want to paste that into one cell without a dialog getting in the way. Additionally, including the trailing newline in the cell text would create a text object cell (same as with hitting Ctrl+Enter during input) instead of a plain text cell, which needs more storage and processing, and would also result in a two lines text height cell.

erAck gravatar imageerAck ( 2020-06-27 18:13:17 +0200 )edit

If the trailing break caused the "csv-mode" to be offered or to be chosen on purpose, the secondary problematic effects would be avoided.
By default to do it as it's done currently would be preferrable if the text to be pasted had differently formatted portions (was a text object). But' that's a very different case then.

Lupp gravatar imageLupp ( 2020-06-27 19:04:03 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-06-26 07:40:11 +0200

Seen: 67 times

Last updated: Jun 27