{"id":112879,"date":"2021-09-13T16:56:42","date_gmt":"2021-09-13T07:56:42","guid":{"rendered":"https:\/\/support.questetra.com\/?p=112879"},"modified":"2022-06-08T16:34:41","modified_gmt":"2022-06-08T07:34:41","slug":"tsv-string-switch-rows-and-columns-2021","status":"publish","type":"post","link":"https:\/\/support.questetra.com\/en\/addons\/tsv-string-switch-rows-and-columns-2021\/","title":{"rendered":"TSV String, Switch Rows and Columns"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#003e04;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#267137;color:#ffffff;border-top-left-radius:0px;border-top-right-radius:0px\">TSV String, Switch Rows and Columns<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\"> Switches the row and column indices of the rectangle TSV. The output matrix (transposed matrix) is obtained by changing cell (x,y) to (y,x). Used for data arrangement for frequency distribution tables and histograms.<\/div><\/div>\n\n\n<div class=\"su-spoiler su-spoiler-style-modern-light su-spoiler-icon-plus-square-1\" data-anchor=\"configs\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span>Configs<\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\">\n<ul class=\"fa-ul\">\n<li><span class=\"fa-li\"><i class=\"far fa-edit fa-lg\"><\/i><\/span> A1: Set Input TSV<span style=\"color:#990000;\"> *<\/span><span style=\"color:#000099;\"><sup style=\"font-style:italic;\">#{EL}<\/sup><\/span><\/li>\n<li> B1: Select STRING DATA that stores Output TSV (update)<span style=\"color:#990000;\"> *<\/span><\/li>\n<li> B2: Select NUMERIC that stores Num of Rows in Output (update)<\/li>\n<li> B3: Select NUMERIC that stores Num of Columns in Output (update)<\/li>\n<\/ul>\n<\/div><\/div>\n\n\n<div class=\"su-spoiler su-spoiler-style-modern-light su-spoiler-icon-plus-square-1 su-spoiler-closed\" data-anchor=\"script\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-spoiler-title\" tabindex=\"0\" role=\"button\"><span class=\"su-spoiler-icon\"><\/span>Script (click to open)<\/div><div class=\"su-spoiler-content su-u-clearfix su-u-trim\">\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>\/\/ GraalJS Script (engine type: 2)\n\n\/\/\/\/\/\/\/\/ START &quot;main()&quot; \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nmain();\nfunction main(){ \n\n\/\/\/\/ == Config Retrieving \/ \u5de5\u7a0b\u30b3\u30f3\u30d5\u30a3\u30b0\u306e\u53c2\u7167 ==\nconst strTsv          = configs.get( &quot;StrConfA1&quot; );           \/\/\/ REQUIRED \/\/\/\/\/\/\/\/\/\/\/\/\/\n  if( strTsv        === &quot;&quot; ){\n    throw new Error( &quot;\\n AutomatedTask ConfigError:&quot; +\n                     &quot; Config {A1: Tsv} is empty \\n&quot; );\n  }\n  const arr2dTsv      = parseAsRectangular( strTsv );\nconst strPocketOutput       = configs.getObject( &quot;SelectConfB1&quot; );  \/\/\/ REQUIRED \/\/\/\/\/\/\/\nconst numPocketNumOfRows    = configs.getObject( &quot;SelectConfB2&quot; );  \/\/ NotRequired \/\/\/\/\/\nconst numPocketNumOfColumns = configs.getObject( &quot;SelectConfB3&quot; );  \/\/ NotRequired \/\/\/\/\/\n\n\n\/\/\/\/ == Data Retrieving \/ \u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u30c7\u30fc\u30bf\u306e\u53c2\u7167 ==\n\/\/ (Nothing. Retrieved via Expression Language in Config Retrieving)\n\n\n\/\/\/\/ == Calculating \/ \u6f14\u7b97 ==\n\n\/\/ output TSV\nlet strOutput = &quot;&quot;;\nfor( let x = 0; x &lt; arr2dTsv[0].length; x++ ){ \/\/ Will be Y in the new TSV\n  for( let y = 0; y &lt; arr2dTsv.length; y++ ){  \/\/ Concatenate vertical data horizontally\n    strOutput += arr2dTsv[y][x];\n    if( y !== arr2dTsv.length - 1 ){\n      strOutput += &quot;\\t&quot;;\n    }\n  }\n  if( x !== arr2dTsv[0].length - 1 ){\n    strOutput += &quot;\\n&quot;;\n  }\n}\n\n\n\/\/\/\/ == Data Updating \/ \u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u30c7\u30fc\u30bf\u3078\u306e\u4ee3\u5165 ==\nengine.setData( strPocketOutput, strOutput );\nif( numPocketNumOfRows !== null ){\n  engine.setData( numPocketNumOfRows, new java.math.BigDecimal( arr2dTsv[0].length ) );\n}\nif( numPocketNumOfColumns !== null ){\n  engine.setData( numPocketNumOfColumns, new java.math.BigDecimal( arr2dTsv.length ) );\n}\n\n\n} \/\/\/\/\/\/\/\/ END &quot;main()&quot; \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\n\/\/ Parses TSV string as two-dimensional rectangular data matrix and creates a 2D array.\nfunction parseAsRectangular( strTsv ){\n  const arrTsv = strTsv.split(&quot;\\n&quot;);\n\n  \/\/\/ Get numMinWidth and numMaxWidth (blank lines are excluded)\n  let numMinWidth   = Infinity; \/\/ cf. String-Type Max: 1 million\n  let numMaxWidth   = 0;\n  let numBlanklines = 0;\n  for( let i = 0; i &lt; arrTsv.length; i++ ){\n    if( arrTsv[i] === &quot;&quot; ){ \/\/ Skip blank lines\n      numBlanklines += 1;\n      continue;\n    }\n    let arrCells = arrTsv[i].split(&quot;\\t&quot;);\n    if( numMinWidth &gt; arrCells.length ){ numMinWidth = arrCells.length; }\n    if( numMaxWidth &lt; arrCells.length ){ numMaxWidth = arrCells.length; }\n  }\n  engine.log( &quot; AutomatedTask TsvDataCheck:&quot; + \n              &quot; MinWidth:&quot; + numMinWidth +\n              &quot; MaxWidth:&quot; + numMaxWidth +\n              &quot; Lines:&quot; + arrTsv.length +\n              &quot; (BlankLines:&quot; + numBlanklines + &quot;)&quot; );\n\n  \/\/\/ Get numMinWidth and numMaxWidth (blank lines are excluded)\n  let arr2dTsv      = [];\n  for( let i = 0; i &lt; arrTsv.length; i++ ){\n    if( arrTsv[i] === &quot;&quot; ){ \/\/ Skip blank lines\n      continue;\n    }\n    let arrTmp = [];\n    let arrCells = arrTsv[i].split(&quot;\\t&quot;);\n    for( let j = 0; j &lt; numMaxWidth; j++ ){\n      if( j &lt; arrCells.length ){\n        arrTmp[j] = arrCells[j];\n      }else{\n        arrTmp[j] = &quot;&quot;;\n      }\n    }\n    arr2dTsv.push( arrTmp );\n  }\n\n  return arr2dTsv;\n}\n\n\/*\nTSV Example:\n2021-08\t1,400\n2021-09\t2,500\n2021-10\t1,900\n\nNotes:\n- When the process reaches this automated task, TSV is automatically read.\n    - TSV: Sales Records, Survey Records, etc.\n- If there is a blank line in the input TSV text, it will be skipped.\n    - The line feed code for the last line is not added either.\n-\u3000The output TSV text (total table TSV, etc.) is rectangular data.\n    - The number of rows in TSV is the number of types of &quot;aggregate Key&quot;.\n    - The number of columns of TSV is 3 of &quot;key&quot;, &quot;count&quot; and &quot;percentage&quot;\n\nAPPENDIX:\n- TSV (Tab Separated Values) text assumes rectangular data.\n    - The number of rows in the output TSV is the number of columns in the input TSV.\n    - The number of columns in the output TSV is the number of rows in the input TSV.\n\n\nNotes-ja:\n- \u6848\u4ef6\u304c\u81ea\u52d5\u51e6\u7406\u5de5\u7a0b\u306b\u5230\u9054\u3057\u305f\u969b\u3001\u6587\u5b57\u5217\u578b\u30c7\u30fc\u30bf\u306b\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308bTSV\u304c\u81ea\u52d5\u7684\u306b\u8aad\u307f\u8fbc\u307e\u308c\u307e\u3059\u3002\n    - TSV: \u58f2\u4e0a\u30ec\u30b3\u30fc\u30c9\u3001\u30a2\u30f3\u30b1\u30fc\u30c8\u56de\u7b54\u30ed\u30b0\u3001\u306a\u3069\n- \u5165\u529bTSV\u30c6\u30ad\u30b9\u30c8\u306b\u7a7a\u884c\u304c\u3042\u308b\u5834\u5408\u3001\u30b9\u30ad\u30c3\u30d7\u3055\u308c\u307e\u3059\u3002\n    - \u51fa\u529bTSV\u306e\u6700\u7d42\u884c\u306b\u6539\u884c\u30b3\u30fc\u30c9\u306f\u4ed8\u4e0e\u3055\u308c\u307e\u305b\u3093\u3002\n- \u51fa\u529b\u3055\u308c\u308bTSV\u30c6\u30ad\u30b9\u30c8\uff08\u5408\u8a08\u5024\u30c6\u30fc\u30d6\u30ebTSV\u7b49\uff09\u306f\u3001\u77e9\u5f62\u30c7\u30fc\u30bf\u3067\u3059\u3002\n    - \u51fa\u529bTSV\u306e\u884c\u6570\u306f\u3001\u5165\u529bTSV\u306e\u5217\u6570\u3067\u3059\u3002\n    - \u51fa\u529bTSV\u306e\u5217\u6570\u306f\u3001\u5165\u529bTSV\u306e\u884c\u6570\u3067\u3059\u3002\n\nAPPENDIX-ja:\n- TSV\uff08Tab Separated Values\uff09\u30c6\u30ad\u30b9\u30c8\u306f\u3001\u77e9\u5f62\u30c7\u30fc\u30bf\u3092\u524d\u63d0\u3068\u3057\u307e\u3059\u3002\n    - \u77e9\u5f62\u3067\u306a\u3044\u30c7\u30fc\u30bf\u306f\u3001\u7a7a\u6587\u5b57\u306b\u3088\u3063\u3066\u81ea\u52d5\u6574\u5f62\u3055\u308c\u307e\u3059\u3002\n    - \u7a7a\u884c\uff08\u672b\u5c3e\u6539\u884c\u3092\u542b\u3080\uff09\u306f\u7121\u8996\u3055\u308c\u307e\u3059\u3002\n*\/\n\n<\/code><\/pre><\/div>\n\n\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright\"><a href=\"#\"><img decoding=\"async\" src=\"data:image;base64,\niVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA5BJREFUWEfF\nl1tIFFEYx3\/jLSu7aBERdgFFKzbJghJ82C5CSZYQQSX1sBXuughZG2gP9ZwgJSG5RuZDYfsUdJEu\n5JbgkhUkbJkVPmRZZLe1crXyMjGzTbtuuztno9jzNjPn+5\/\/+c7\/+\/5nJGI8JOH1G5iCzFYk1iKT\ni8QiIPVXvAeZF0h0InMbiYuYGRLB1ifQxFx+UAlYgGQRUOAbYCeJaky8jRQTmYAdCxI1wFTBhYOn\neZE5hAV7uPjwBBo4BZT95cLBYfWYsYbCCk3ATjMSO\/\/R4j4YmQtYKAnG\/JPAv925biYmEvCdeb3I\nzjct2ERyfDI3+27ydeSrSIiWibJATfgJ+NTeIyK4kswS6vLrSIxLpPJeJaeeKHIRHl6SyNSqw0+g\ngRNAhQhMo7ERU7YJCYnW160UtBSIhAXOqcXMAeWFj4DSZOCjSJ1nzcji8obLZM\/MVkM93z2Uu8pp\n7mmOhoTSJ2YpzcpHwM4uJM6JIBxefpijK4+q5+8Tt4yjx0GJ8w+BR4aT2Y2F81oGGoE9IgSubrzK\nunnrGJPHSElMUUN6B3vZcWsHHe86RCC0OWcxs1fLwEMkcvWiC+cX0rSmieefnzPwfYCihUWqDkbG\nRzjuPk7V\/So9CP93mU4srNAy8CnAWMKCKMrft3gftY9qcX9yq5WQOsnnR50fOjFeMUZTkh7MpGkE\nZD3q0xKn0ba5jbTkNDXdXZ4u9Tl3ti9xgyOD0ZekGUmYgHWplerV1TjfOCm+UawuWpNXw37DfhLi\nEtTnlpctFF0v0tuL\/3sAAd0jcKx3sD1je0Tw\/uF+THdMXHt1TYREwBHYiSjCvDl5OAocjI2P4ep3\nTQA3pBp+H8O4PM7p7tOUtQuYaJAII5bhsVXHqFhWwZmnZ9SmEzi0o9FK8tnAM7bc2KJWis6YUIYR\nG5Gr2EXG9IyQ6dXEqYnRO+ql6l4VdV11UTWisK1YM57ugW7yL+WHBFUydDDnoGpOgmIMasVKVAgz\nUjrekRVHMM4z0v62HdtdGw\/eP5hAIn1qOqVLSrHl2JiSoOwDtRecfHwS+xM7fd6+UKSDzEiZEmTH\n7m1uDGkGhkaHUMQVJ8WpCzhfO3+7n0JO8Yak+CSGR4dVX1BGvBTP5ITJfPnxBWu7NdiowtixEhnF\nhURPYWG\/y4S5kGgRMb2SaSRiein9P5mI8lruz0QMf0w0EjH9NQuUcsx+Tv+63sQCfwL9gFkwfk0h\nYgAAAABJRU5ErkJggg==\n\" alt=\"\"\/><\/a><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><i class=\"fal fa-cloud-download-alt\"><\/i> Download<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/drive.google.com\/file\/d\/1fz3RVp3rgJrySJAl7IsCNAsYgUZpvOzi\/view?usp=drivesdk\" target=\"_blank\" rel=\"noreferrer noopener\">Tsv-String-Switch-Rows-and-Columns-2021.xml<\/a><\/li><\/ul>\n\n\n\n<p class=\"has-text-align-right has-small-font-size wp-block-paragraph\">2021-09-10 (C) Questetra, Inc. (MIT License)<br><a href=\"https:\/\/support.questetra.com\/en\/addons\/tsv-string-switch-rows-and-columns-2021\/\">https:\/\/support.questetra.com\/addons\/tsv-string-switch-rows-and-columns-2021\/<\/a><br><i class=\"fal fa-info-circle\"><\/i> The Add-on import feature is available with <span style=\"color:#4a86e8\" class=\"has-inline-color\"><strong>Professional<\/strong><\/span> edition.<br>Freely modifiable JavaScript (ECMAScript) code. No warranty of any kind.<\/p>\n\n\n<div class=\"su-divider su-divider-style-dashed\" style=\"margin:30px 0;border-width:8px;border-color:#009900\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><i class=\"fal fa-lightbulb-exclamation\"><\/i> Notes<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>When the process reaches this automated task, the TSV is read automatically.<ul><li>TSV: Sales Records, Survey Records, etc.<\/li><\/ul><\/li><li>If there is a blank line in the input TSV text, it will be skipped.<ul><li>The line feed code for the last line is not added either.<br>-\u3000The output TSV text (total table TSV, etc.) is rectangular data.<\/li><li>The number of rows in TSV is the number of types of &#8220;aggregate Key&#8221;.<\/li><li>The number of columns of TSV is 3; key, count and percentage<\/li><\/ul><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><i class=\"fal fa-images\"><\/i> Capture<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-capture-en.png?ssl=1\" target=\"_blank\" rel=\"noopener\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"675\" data-attachment-id=\"112867\" data-permalink=\"https:\/\/support.questetra.com\/en\/maintenance\/maintenance-20251117\/attachment\/tsv-string-switch-rows-and-columns-2021-capture-en\/\" data-orig-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-capture-en.png?fit=1200%2C675&amp;ssl=1\" data-orig-size=\"1200,675\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"tsv-string-switch-rows-and-columns-2021-capture-en\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-capture-en.png?fit=1024%2C576&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-capture-en.png?resize=1200%2C675&#038;ssl=1\" alt=\"Switches the row and column indices of the rectangle TSV. The output matrix (Transposed Matrix) is obtained by changing cell(x,y) to (y,x). Used for data arrangement for frequency distribution tables and histograms.\" class=\"wp-image-112867\" srcset=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-capture-en.png?w=1200&amp;ssl=1 1200w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-capture-en.png?resize=560%2C315&amp;ssl=1 560w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-capture-en.png?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-capture-en.png?resize=768%2C432&amp;ssl=1 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default q-box\"><a href=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-config-en.png?ssl=1\" target=\"_blank\" rel=\"noopener\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"947\" height=\"630\" data-attachment-id=\"112871\" data-permalink=\"https:\/\/support.questetra.com\/en\/maintenance\/maintenance-20251117\/attachment\/tsv-string-switch-rows-and-columns-2021-config-en\/\" data-orig-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-config-en.png?fit=1198%2C797&amp;ssl=1\" data-orig-size=\"1198,797\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"tsv-string-switch-rows-and-columns-2021-config-en\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-config-en.png?fit=947%2C630&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-config-en-947x630.png?resize=947%2C630&#038;ssl=1\" alt=\"Switches the row and column indices of the rectangle TSV. The output matrix (Transposed Matrix) is obtained by changing cell(x,y) to (y,x). Used for data arrangement for frequency distribution tables and histograms.\" class=\"wp-image-112871\" srcset=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-config-en.png?resize=947%2C630&amp;ssl=1 947w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-config-en.png?resize=473%2C315&amp;ssl=1 473w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-config-en.png?resize=768%2C511&amp;ssl=1 768w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-config-en.png?w=1198&amp;ssl=1 1198w\" sizes=\"auto, (max-width: 947px) 100vw, 947px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><i class=\"fal fa-book\"><\/i> Appendix<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>TSV (Tab Separated Values) text assumes rectangular data.<ul><li>The number of rows in the output TSV is the number of columns in the input TSV.<\/li><li>The number of columns in the output TSV is the number of rows in the input TSV.<\/li><\/ul><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><i class=\"fal fa-balance-scale\"><\/i> See also<\/h3>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-questetra-support wp-block-embed-questetra-support\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"Nyuk9JouoX\"><a href=\"https:\/\/support.questetra.com\/en\/addons\/tsv-string-create-cross-table-for-numeric-column-2021\/\">TSV String, Create Cross Table for Numeric Column<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;TSV String, Create Cross Table for Numeric Column&#8221; &#8212; Questetra Support\" src=\"https:\/\/support.questetra.com\/addons\/tsv-string-create-cross-table-for-numeric-column-2021\/embed\/#?secret=KkStFM7kQ0#?secret=Nyuk9JouoX\" data-secret=\"Nyuk9JouoX\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-questetra-support wp-block-embed-questetra-support\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"f53P9PqMzI\"><a href=\"https:\/\/support.questetra.com\/en\/addons\/image-charts-bar-chart-create-2021\/\">Image-Charts #Bar-Chart: Create<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Image-Charts #Bar-Chart: Create&#8221; &#8212; Questetra Support\" src=\"https:\/\/support.questetra.com\/addons\/image-charts-bar-chart-create-2021\/embed\/#?secret=XPH9FmlYIp#?secret=f53P9PqMzI\" data-secret=\"f53P9PqMzI\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Switches the row and column indices of the rectangle TSV. The output matrix (Transposed Matrix) is obtained by changing cell(x,y) to (y,x). Used for data arrangement for frequency distribution tables and histograms.<\/p>\n","protected":false},"author":2,"featured_media":112875,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","_uag_custom_page_level_css":"","advanced_seo_description":"Switches the row and column indices of the rectangle TSV. The output matrix (Transposed Matrix) is obtained by changing cell(x,y) to (y,x). Used for data arrangement for frequency distribution tables and histograms.","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_seo_schema_type":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_wpcom_ai_launchpad_first_post":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"{title}\n\n{excerpt}\n\n{url}","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wpas_customize_per_network":false,"jetpack_post_was_ever_published":false},"categories":[168],"tags":[365,389,2535],"class_list":["post-112879","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-addons","tag-easy-config-addon","tag-tsv-csv","tag-workflow-automation"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?fit=1200%2C675&ssl=1","uagb_featured_image_src":{"full":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?fit=1200%2C675&ssl=1",1200,675,false],"thumbnail":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?resize=440%2C440&ssl=1",440,440,true],"medium":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?fit=560%2C315&ssl=1",560,315,true],"medium_large":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?fit=768%2C432&ssl=1",768,432,true],"large":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?fit=1024%2C576&ssl=1",1024,576,true],"1536x1536":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?fit=1200%2C675&ssl=1",1200,675,true],"2048x2048":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?fit=1200%2C675&ssl=1",1200,675,true],"newspack-article-block-landscape-large":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?resize=1200%2C675&ssl=1",1200,675,true],"newspack-article-block-portrait-large":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?resize=900%2C675&ssl=1",900,675,true],"newspack-article-block-square-large":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?resize=1200%2C675&ssl=1",1200,675,true],"newspack-article-block-landscape-medium":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?resize=800%2C600&ssl=1",800,600,true],"newspack-article-block-portrait-medium":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?resize=600%2C675&ssl=1",600,675,true],"newspack-article-block-square-medium":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?resize=800%2C675&ssl=1",800,675,true],"newspack-article-block-landscape-intermediate":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?resize=600%2C450&ssl=1",600,450,true],"newspack-article-block-portrait-intermediate":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?resize=450%2C600&ssl=1",450,600,true],"newspack-article-block-square-intermediate":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?resize=600%2C600&ssl=1",600,600,true],"newspack-article-block-landscape-small":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?resize=400%2C300&ssl=1",400,300,true],"newspack-article-block-portrait-small":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?resize=300%2C400&ssl=1",300,400,true],"newspack-article-block-square-small":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?resize=400%2C400&ssl=1",400,400,true],"newspack-article-block-landscape-tiny":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?resize=200%2C150&ssl=1",200,150,true],"newspack-article-block-portrait-tiny":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?resize=150%2C200&ssl=1",150,200,true],"newspack-article-block-square-tiny":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?resize=200%2C200&ssl=1",200,200,true],"newspack-article-block-uncropped":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/09\/tsv-string-switch-rows-and-columns-2021-nocode-en.png?fit=1200%2C675&ssl=1",1200,675,true]},"uagb_author_info":{"display_name":"IMAMURA, Genichi","author_link":"https:\/\/support.questetra.com\/en\/author\/imamuragenichi\/"},"uagb_comment_info":1,"uagb_excerpt":"Switches the row and column indices of the rectangle TSV. The output matrix (Transposed Matrix) is obtained by changing cell(x,y) to (y,x). Used for data arrangement for frequency distribution tables and histograms.","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9DiIh-tmD","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":96354,"url":"https:\/\/support.questetra.com\/en\/addons\/google-sheets-sheet-append-tsv\/","url_meta":{"origin":112879,"position":0},"title":"Google Sheets: Sheet, Append TSV","author":"IMAMURA, Genichi","date":"2020-10-14","format":false,"excerpt":"Adds the TSV dataset after the last row. New rows will be inserted into the sheet if necessary. Only the specified columns of TSV are added, column ID with an identifier \"d\" as Datetime, and column ID with an identifier \"n\" as Numeric; eg \"0,2d,5n\".","rel":"","context":"In &quot;Add-ons&quot;","block_context":{"text":"Add-ons","link":"https:\/\/support.questetra.com\/en\/category\/addons\/"},"img":{"alt_text":"Google Sheets: Sheet, Append TSV","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/10\/Google-Sheets-Sheet-Append-TSV-en.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/10\/Google-Sheets-Sheet-Append-TSV-en.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/10\/Google-Sheets-Sheet-Append-TSV-en.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/10\/Google-Sheets-Sheet-Append-TSV-en.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/10\/Google-Sheets-Sheet-Append-TSV-en.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":79781,"url":"https:\/\/support.questetra.com\/en\/data-items\/table-type\/","url_meta":{"origin":112879,"position":1},"title":"Table-Type","author":"Peter Glover","date":"2021-01-22","format":false,"excerpt":"Displays a table that can use the String, Numeric, Select or Date formats.","rel":"","context":"In &quot;Data Items&quot;","block_context":{"text":"Data Items","link":"https:\/\/support.questetra.com\/en\/category\/data-items\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2019\/09\/Table.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2019\/09\/Table.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2019\/09\/Table.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2019\/09\/Table.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2019\/09\/Table.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":84096,"url":"https:\/\/support.questetra.com\/en\/addons\/two-tsv-strings-compare-numeric-cells\/","url_meta":{"origin":112879,"position":2},"title":"Two Tsv Strings, Compare Numeric Cells","author":"IMAMURA, Genichi","date":"2020-01-30","format":false,"excerpt":"Compares numeric column strings in TSV-A and TSV-B, and lists the amount of change from A to B. If there is no string that matches the key column of A, it will not be listed. If there are multiple matches, it will be compared with the key above.","rel":"","context":"In &quot;Add-ons&quot;","block_context":{"text":"Add-ons","link":"https:\/\/support.questetra.com\/en\/category\/addons\/"},"img":{"alt_text":"Two Tsv Strings, Compare Numeric Cells","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/01\/Two-Tsv-Strings-Compare-Numeric-Cells-en.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/01\/Two-Tsv-Strings-Compare-Numeric-Cells-en.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/01\/Two-Tsv-Strings-Compare-Numeric-Cells-en.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/01\/Two-Tsv-Strings-Compare-Numeric-Cells-en.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/01\/Two-Tsv-Strings-Compare-Numeric-Cells-en.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":70950,"url":"https:\/\/support.questetra.com\/en\/addons\/tsv-filteringbynumber\/","url_meta":{"origin":112879,"position":3},"title":"TSV Filtering by Number","author":"Hirotaka NISHI","date":"2018-11-14","format":false,"excerpt":"Filter the rows on tab-delimited text (TSV) stored in String type Data Item by a range of numbers and save it","rel":"","context":"In &quot;Add-ons&quot;","block_context":{"text":"Add-ons","link":"https:\/\/support.questetra.com\/en\/category\/addons\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2018\/11\/tsv-filter-by-number-header.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2018\/11\/tsv-filter-by-number-header.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2018\/11\/tsv-filter-by-number-header.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2018\/11\/tsv-filter-by-number-header.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2018\/11\/tsv-filter-by-number-header.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":82695,"url":"https:\/\/support.questetra.com\/en\/addons\/tsv-string-filter-by-numeric\/","url_meta":{"origin":112879,"position":4},"title":"TSV String, Filter by Numeric","author":"IMAMURA, Genichi","date":"2021-02-01","format":false,"excerpt":"Filters TSV strings using a numeric range. Only the rows where the specified numeric column is included in the numeric range are output. If you want to OR multiple ranges, specify them in comma separated form like \"-100","rel":"","context":"In &quot;Add-ons&quot;","block_context":{"text":"Add-ons","link":"https:\/\/support.questetra.com\/en\/category\/addons\/"},"img":{"alt_text":"TSV String, Filter by Numeric","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2019\/12\/TSV-String-Filter-by-Numeric-en.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2019\/12\/TSV-String-Filter-by-Numeric-en.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2019\/12\/TSV-String-Filter-by-Numeric-en.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2019\/12\/TSV-String-Filter-by-Numeric-en.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2019\/12\/TSV-String-Filter-by-Numeric-en.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":97139,"url":"https:\/\/support.questetra.com\/en\/addons\/google-sheets-sheet-row-update-with-singleline-tsv\/","url_meta":{"origin":112879,"position":5},"title":"Google Sheets: Sheet Row, Update with Singleline TSV","author":"IMAMURA, Genichi","date":"2020-10-28","format":false,"excerpt":"Updates a Google Sheet with a single line of TSV data. Searches for an A-Column cell that exactly matches the first value of the TSV and overwrite only the first occurrence. The values will be parsed as if they were entered manually by the user. If no matching line exists,\u2026","rel":"","context":"In &quot;Add-ons&quot;","block_context":{"text":"Add-ons","link":"https:\/\/support.questetra.com\/en\/category\/addons\/"},"img":{"alt_text":"Google Sheets: Sheet Row, Update with Singleline TSV","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/10\/Google-Sheets-Sheet-Row-Update-with-Singleline-TSV-en.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/10\/Google-Sheets-Sheet-Row-Update-with-Singleline-TSV-en.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/10\/Google-Sheets-Sheet-Row-Update-with-Singleline-TSV-en.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/10\/Google-Sheets-Sheet-Row-Update-with-Singleline-TSV-en.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/10\/Google-Sheets-Sheet-Row-Update-with-Singleline-TSV-en.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"amp_enabled":false,"_links":{"self":[{"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/posts\/112879","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/comments?post=112879"}],"version-history":[{"count":7,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/posts\/112879\/revisions"}],"predecessor-version":[{"id":112963,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/posts\/112879\/revisions\/112963"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/media\/112875"}],"wp:attachment":[{"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/media?parent=112879"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/categories?post=112879"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/tags?post=112879"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}