No Python on this machine to confirm, but I think this might work: bank_string = "BUSINESS xxxxx MERCHANT PURCHASE TERMINAL xxxxxxxx CITY NAME HERE DEBIT CARD PURCHASE 11-01-19 12:00 AM XXXXXXXXXXXXXXXX" split_string = bank_stream.split() s = " " a = bank_stream [0] b = bank_stream [1] c = bank_stream [2] str = s.join('a','b','c') print(str)
BUSINESS xxxxx MERCHANT There are more compact ways of doing this, especially if you load pandas, but you can see the steps this way. Don Smith will be along shortly to suggest a better approach. :-) |