I'm capturing a file with the following content:
*> <'Char><'Char><'space><'string>*
example: Original File
Fs .file1
M /home/file2
?? /home/file3
M /home/file4
D /home/file5
I'm trying to get each line into a list and get always one array with 2 columns. I tried
line.split(' ')
but it is not working since an empty char might happen on the first or second position of each row.
so, I need to do this split after the second character, meaning the result of the above file will be:
['Fs','.file1']
[' M','./home/file2']
['??','./home/file3']
['M ','./home/file4']
[' D','./home/file5']
It would be also acceptable if the empty character on the firl array index is trimmed
['Fs','.file1']
['M','./home/file2']
['??','./home/file3']
['M ','./home/file4']
['D','./home/file5']
split(" ")and showed the input and expected output so I think it is a fair question, I don't think they expected the file part just how to split correctly which would not be that obvious to some people.