jeudi 13 juin 2019

How to read a tab formatted text in a textarea with JavaScript (Vuejs)

I am trying to read a text that is the product of copying in a word table, so the format is so confuse.

I need to separate the rows as an objects in a array, with the columns as properties of that object, all of this things using Vuejs (ES6) or JavaScript

This is a screenshot of the word table with his columns: word screenshot

.code           
        Input   
        store   N
        load    cero
        store   sum 
    initWhile   Load    N
        sub cero
        jz  endWhile
        load    sum
        add N
        store   Sum
        load    n
        sub Uno
        Store   N
        jmp initWhile
    endWhile    load    sum
        output  
        halt    
.data           
    n       
    Cero        
    Sum     
    Uno     

    def uno 01

There is the way how the data is copied in the word table, apparently is based on tab, but sometimes the info is overlaying other columns.

Thanks in advance!




Aucun commentaire:

Enregistrer un commentaire