[Worked around] Copy to clipboard with tab seperators?

I’m trying to copy several items on a single web page in order to paste them into a row on a pre-formatted spreadsheet. To make this easy, I’m trying to use a tab to separate each value so that they get pasted into the right cells. I’ve been trying various methods, but none seem to work. I’m using a test script for now that is basically:
store data !clipboard

I’ve tried the following separators within the data and got the results noted

Separator Result
An actual tab character Converts to \t in the !clipboard variable, appears as a space when I paste the data
\t Remains as \t in !clipboard and gets pasted as \t
${TAB} Causes an error, no data is put into !clipboard

Can anyone help?

This is a good question. I thought aa\tbb should work, but it does not. It just creates a space when I paste it in Excel. But aa\nbb works as expected, it creates a new line in the editor, and a new row in Excel (as expected).

Workaround: You can use XType. First send ALT+TAB to switch to the next open app (e. g. Excel) and then send the text plus tabs:


This way you even save the manual pasting.

Another solution would be to export the data to CSV with CSVsave, and then import it to your spreasheet.

Many thanks Ulrich. For some reason ALT+TAB didn’t work, even though it’s fine manually. I’m running Linux Mint using XFCE though and I was able to use CTRL+ALT and right arrow with the spreadsheet in the next workspace, which works perfectly, and also keeps the spreadsheet where I wanted it as well.