for formatting a string and adding descriptors: test = 'datetimepart1part2part3the_rest' newtest = 'date=' + test[0:4] + ' time=' + test[4:8] + ' part1=' + test[8:13] + ' part2=' + test[13:18] + ' part3=' + test[18:23] + ' the rest=' + test[23:]
and while this may be ugly, it does what I want it to do. The question is, if instead of 'the_rest' I have ']the_rest' and sometimes there's not just one. how do I handle that? In other words, this script will iterate over numerous lines in a file, and each one is identical up to the delimiter before the rest, and sometimes there is only one, sometimes there is two, they vary in length. Can I stop using position numbers and start looking for specific characters (the delimiter) and proceed to the end (which is always a constant string btw). regards, Richard -- Windows assumes you are an idiot…Linux demands proof. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor