0

I'm trying create a new column in my tab-delimited text file using Python.

Currently each row looks like

"Mk 1:23" \t "text" \n

and I would like to change each of them to

"Mk" \t "1:23" \t "text" \n
Enlico
  • 17,834
  • 5
  • 39
  • 78
anomicgold
  • 25
  • 5
  • 1
    replace the space character with the tab character. https://docs.python.org/2/library/string.html#string.replace – Oxymoron Feb 05 '20 at 19:03
  • 1
    This question could be similar to this one - https://stackoverflow.com/questions/9452108/how-to-use-string-replace-in-python-3-x – Oxymoron Feb 05 '20 at 19:04
  • 1
    @Oxymoron, your first solution was perfect. Just got rid of the first instance of space and replaced with "\t". Thanks for your help. Why don't you answer the question and I will let you have the rights to the answer. – anomicgold Feb 05 '20 at 19:27
  • It seems you would need to replace the space with `"\t"`. – Booboo Feb 05 '20 at 19:41

0 Answers0