Hi,
I'm a newbie to python and I'm reading a file and trying to split a string every 3 spaces, that is included any whitespace. string.split() will split the string up every whitespace, but is there another way to specify every 3 spaces, whether there is whitespace or not? I'm trying to do this example:
string = '491 43140113108107 11210'
and split it every 3 spaces. So I can pull out the numbers:
string = '491 43 140 113 108 107 11 210'
Morika 0 Newbie Poster
snippsat 661 Master Poster
Morika 0 Newbie Poster
snippsat 661 Master Poster
sravan953
Morika 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.