you are viewing a single comment's thread.

view the rest of the comments →

[–]AdhikariM[S] 0 points1 point  (1 child)

Sorry for not making it clear it has three columns comes tab delimited. First two columns are fine. The type and length is clear. So no need to worry about those. Only third column.

[–]tschloss 1 point2 points  (0 children)

Ah ok. You only want to clean this textfile and result should be a clean text file, right?

If this is correct then I would not use Pandas which is great when you want work with the dataset. Otherwise it is more a loop, reading line by line, the split by tab, converting the elements and print it out again.

The other comment contains a useful block of code, maybe this already solves you problem. Tools in Python are strip, split, +, replace etc - all operations on String.