Include Option to Paste Spreadsheet Row Directly as Column Wave

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.

how about this:

menu "edit", hideable, dynamic
    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

 

Thank you. It looks interesting. Once I get back to the entire data set, I give it a test run.

Forum

Support

Gallery

Igor Pro 9

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More