Commit 8b4e51d3 authored by Mikaël Salson's avatar Mikaël Salson

tools.js: trim lines from IMGT “CSV” output

Lines may contain a variable number of tabs at their ends which may cause
the failure of the import of their data

Fixes #3163
parent fafbda6e
Pipeline #21804 passed with stages
in 5 minutes and 54 seconds
......@@ -25,11 +25,11 @@ function nth_ocurrence(str, needle, nth) {
*/
function tsvToArray(allText) {
var allTextLines = allText.split(/\r\n|\n/);
var headers = allTextLines[0].split(' ');
var headers = $.trim(allTextLines[0]).split(' ');
var lines = [];
for (var i = 1; i < allTextLines.length; i++) {
var data = allTextLines[i].split(' ');
var data = $.trim(allTextLines[i]).split(' ');
if (data.length == headers.length) {
var tarr = {};
for (var j = 0; j < headers.length; j++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment