Python

Moderators: None (Apply to moderate this forum)
Number of threads: 474
Number of posts: 1166

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Recursive File Read, update Posted by spicysudhi on 6 Jan 2010 at 4:34 AM
hi,

I am very new to python and thanks for your support.

I am trying to write a program to read all the .DAT files in the given folder and its sub folders.

Then in each of the .DAT file, I want to replace a perticular string - this string appears within first 10 lines in the file.

For example: The files have below string on line 4 or 7.
Name : TESTNAME

I want to update (append) the name with the filename. The output is like
Name : FILENAME_TESTNAME
(FILENAME is the name of the file without .DAT extension)

any help... thanks.
Thread Tree
spicysudhi Recursive File Read, update on 6 Jan 2010 at 4:34 AM
utpalendu Re: Recursive File Read, update on 16 Apr 2010 at 3:21 AM



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.