I have a massive ASCII data table with several consecutive white spaces as separators and missing data as follows:
493802.2.38...9.................11...
5221.8.23.............7.........1.
1383782.51.............16.......1...
I need to read it with pandas to be as follows, which consider the first white space as a separator while the second as a column missing data
493802 |2 |38| |9| | | | | | | | |11| |
5221 |8 |23| | | | | | |7 | | | | |1|
1383782|51| | | | | | | |16| | | |1 | |
I have tried
df = pd.read_csv('file.txt', sep='\s+',header=None,engine='python')
but it considers any count of white spaces as the delimiter so it parses the file into only five columns
And tried
df = pd.read_csv('file.txt', sep='\s',header=None,engine='python')
but it returns the error that expected fields are less than what pandas saw
Finally, I've even tried some other parameters such as quoting or line-terminator but no success. any help?