delete a list in text file well i m having a text file which contain time,user name & id, now if i want to modify the time without affecting the id & user name is it possible?
or how i delete that list & enter a new list in that text file
nitinloml 0 Newbie Poster
Recommended Answers
Jump to PostIt would be nice, if you could give us an actual example, so we don't have to guess too wildly!
Jump to PostAh. Here's a stab:
def change_time(record, new_time): name,id,time = record.split('|') time = str(new_time) record = '|'.join((name,id,time)) + '|' return record
Jeff
All 7 Replies
bumsfeld 413 Nearly a Posting Virtuoso
nitinloml 0 Newbie Poster
nitinloml 0 Newbie Poster
jrcagle 77 Practically a Master Poster
nitinloml 0 Newbie Poster
icsoka 0 Newbie Poster
woooee 814 Nearly a Posting Maven
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.