Saturday, 8 June 2013

Excel Table to Jira Table

Excel table, meet Jira :-). After writing the previous AutoHotkey script to convert the clipboard contents to a comma separated list, I wrote this one. It makes constructing Jira tables a breeze.

;;; Converts a copied table from Excel into Jira format
#+j::
  StringReplace, ForFirstLine, Clipboard, `r`n, §
  StringSplit, ForFirstLine, ForFirstLine, §
  StringReplace, ForFirstLine1, ForFirstLine1, %A_Tab%, ||, All
  StringReplace, ForFirstLine2, ForFirstLine2, %A_Tab%, |, All
  ForFirstLine2 := RTrim(ForFirstLine2, "`r`n")
  StringReplace, ForFirstLine2, ForFirstLine2, `r`n, |`r`n|, All
  Clipboard := "||" . ForFirstLine1 . "||`r`n|" . ForFirstLine2 . "|"
  Send ^v
Return


To use it, just press Windows+Shift+J (but that's easily changed). It puts double pipes on the first line, and single pipes on other lines.

10 comments:

  1. Genius - this has just saved me a lottttttta time.
    much appreciated.

    ReplyDelete
  2. Thanks for the appreciate rav124 :-D. I'm always happy to hear something I've written is being used.

    P.S. While I'm here - for others using the script, it works best if it's saved as a Unicode text file because of the "§".

    ReplyDelete
  3. how do you add this to JIRA exactly ? this piece of code is to be put somewhere i guess but where exactly ?

    ReplyDelete
  4. anyone looking at this page ?

    ReplyDelete
  5. Hi sileclercq

    You need to download and use the program at http://www.autohotkey.com

    Then replace the code in the example file with the code above.

    //Kasper

    ReplyDelete
  6. I am getting an error for call to non existent function
    --> ForFirstLine2 := RTrim(ForFirstLine2, "`r`n")

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  7. You're using an older version, get the new one here: http://ahkscript.org/

    ReplyDelete
  8. Excel 2003 introduced a neat feature for helping anyone enter data easily and quickly with the arrival of the "list". excel dashboard software

    ReplyDelete
  9. However, there are detailed macros and scripts which are essential in making the critical financial and business decision right at a point of time.salesforce custom dashboard

    ReplyDelete