Include Option to Paste Spreadsheet Row Directly as Column Wave
jjweimer
I copied a row of data from a spreadsheet and went to Igor Pro to paste it as a wave. The paste dialog recognizes that I have six columns in the clipboard but one column in the data table. Unfortunately, the only two options are to paste one column or cancel. It seems, I have to go through an intermediate step.
Can this dialog be expanded to include an option to paste a row directly as a column wave? This will save the tedious manual conversion process.
FWIW, I used the command line to do the assignment `wave = { ...}`. I pasted the row data in the {...} and then replaced all the tabs by hand with commas.
Forum
Support
Gallery
Igor Pro 9
Learn More
Igor XOP Toolkit
Learn More
Igor NIDAQ Tools MX
Learn More
how about this:
TableClipMenu("Transpose Paste"), TransposePaste()
end
function /s TableClipMenu(str)
string str
if(WinType("")==2)
return str
endif
return ""
end
function TransposePaste()
string clip=getScrapText(), sOut=""
variable rows=itemsinlist(clip, "\r")
variable columns=itemsinlist(stringfromlist(0,clip,"\r"), "\t")
variable i,j
for(i=0;i<columns;i+=1)
for(j=0;j<rows;j+=1)
sOut+=stringfromlist(i,stringfromlist(j, clip,"\r"), "\t")+"\t"
endfor
sOut=removeEnding(sOut,"\t")
sOut+="\r"
endfor
putscrapText sOut
doIgorMenu "Edit", "Paste"
putscrapText clip
end
May 14, 2019 at 02:37 am - Permalink
Thank you. It looks interesting. Once I get back to the entire data set, I give it a test run.
May 14, 2019 at 06:43 pm - Permalink
In reply to how about this: menu "edit… by tony
Tony's solution is really helpful (especially when the menu item is given a hotkey). Thanks to you both for raising the question and addressing it!
May 21, 2019 at 11:25 am - Permalink