Hi,
I'm new to Python and I'm trying to make a program that can:
1 : Open multiple text files with raw input.
2 : Save each text file with it's content. (and assign every file with a unique number).
Later I want to search for one or more words in the files.
I hope you can help me getting started.
Thanks
Open and search multiple text files
Page 1 of 11 Replies - 197 Views - Last Post: 05 December 2012 - 04:04 AM
Replies To: Open and search multiple text files
#2
Re: Open and search multiple text files
Posted 05 December 2012 - 04:04 AM
you can't open them with raw input. Are you talking about opening them with what you get from raw_input? If so, just make sure the directory is correct and type
Not sure what you mean by saving each text file with it's content. If the text file already exists why save it?
For searching through text files look into regular expression (re module).
hopefully that'll get you started...
r = open('filename','r')
Not sure what you mean by saving each text file with it's content. If the text file already exists why save it?
For searching through text files look into regular expression (re module).
hopefully that'll get you started...
This post has been edited by alexr1090: 05 December 2012 - 04:08 AM
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|