Read whole file and parse it for different purpose


Hello all,

I am going to create new package for my BASIC language. In this package I have to read whole BASIC file and need to get first 5 chars of each line. How can I do this ? Any suggestions?

Python UI


You can do the following in javascript/es6 (you need a reference to the text editor containing the code):

textEditor.getText().split('\n').map(line => line.slice(0, 5))


@olmokramer Thanks for answer (I am new to all this)