Hey I'm currently using python to read a list of string in a txt file and I wanted to cut off multiple strings in the front e.g
example in my txt file:
Jack: Black
Jack: Sparrow
Jimm: Oliver
Jimm: Next
Jimm: Red
Ston: Cold
Bill: Black
I wanted to remove the first 5 string (including ':') from each line so the desired result might be
Black
Sparrow
Oliver
Next
Red
Cold
Black
I've been trying using .replace() but I cannot determine the string neither using string slicing (it will cut only the few characters in the first line)
currently my program looks like this:
with open("C:\\Documents and Settings\\Zha\\Desktop\\test3.txt", "r") as text:
a = text.read()
b = str(a).replace(a[:5],'')
print b
and the current output is
Black
Sparrow
Jimm: Oliver
Jimm: Next
Jimm: Red
Ston: Cold
Bill: Black
awk test3.txt '{print $2}'