a="SCT/PS/BARREL/Q1/BARREL2/HVchCurr 03-04-2015 23:56:25:292 6.817800E+04" print a b=a.split() <========= ()なら連続spaceも扱う print "0 : %s" %b[0] print b[1] print b[2] print b[3] c=b[1].split("-") print "%s %s %s" %(c[0],c[1],c[2]) c1,c2,c3=b[1].split("-") print "%s %s %s" %(c1,c2,c3) print b import re <========= reをいれること   multiple separators x="72194.00 04-03-2015 00:04:17:465" #x1,x2,x3,x4,x5,x6,x7,x8,x9ZZ=x.split("-") z1=re.split("[: \-]",x) <========= -はrange indicatorと区別するため\を入れること print "%s %s %s" %(z1[0],z1[1],z1[2]) x1,x2,x3,x4,x5,x6,x7,x8=re.split("[ :\-]",x) print "%s %s %s %s %s %s %s %s" %(x1,x2,x3,x4,x5,x6,x7,x8) print "#-------for data with negative values" a=" -0.3363000 03-04-2015 21:42:04:909" print a b=a.split() print b[0] print b[1] print b[2] d,m,y=b[1].split("-") print "%s into %s %s %s" %(b[1], d,m,y) h,mi,s,ss=b[2].split(":") print "%s into %s %s %s %s" %(b[2],h,mi,s,ss) =================================== $ python split.py SCT/PS/BARREL/Q1/BARREL2/HVchCurr 03-04-2015 23:56:25:292 6.817800E+04 0 : SCT/PS/BARREL/Q1/BARREL2/HVchCurr 03-04-2015 23:56:25:292 6.817800E+04 03 04 2015 03 04 2015 ['SCT/PS/BARREL/Q1/BARREL2/HVchCurr', '03-04-2015', '23:56:25:292', '6.817800E+04'] 72194.00 04 03 72194.00 04 03 2015 00 04 17 465 #-------for data with negative values -0.3363000 03-04-2015 21:42:04:909 -0.3363000 03-04-2015 21:42:04:909 03-04-2015 into 03 04 2015 21:42:04:909 into 21 42 04 909