I need to split the string based on whitespaces:
mystring = ['1 SLES11 SP1 64bit [datastore1] SLES11 SP1 64bit/SLES11 SP1 64bit.vmx sles11_64Guest vmx-08 ']
#Removes white spaces
mystring.strip()
I want to achieve, similar to awk output :
# awk '{print $1, $2}' mystring
1 SLES11 SP1 64bit
I need to push the output similar to awk to array and read data.
Thanks in advance.
So you want to split on two or more whitespace characters?