Re: Python: Deleting specific words from a file.

2011-09-12 Thread MRAB
On 12/09/2011 20:49, gry wrote: On Sep 9, 2:04 am, Terry Reedy wrote: On 9/8/2011 9:09 PM, papu wrote: Hello, I have a data file (un-structed messy file) from which I have to scrub specific list of words (delete words). Here is what I am doing but with no result: infile = "messy_data_

Re: Python: Deleting specific words from a file.

2011-09-12 Thread gry
On Sep 9, 2:04 am, Terry Reedy wrote: > On 9/8/2011 9:09 PM, papu wrote: > > > > > Hello, I have a data file (un-structed messy file) from which I have > > to scrub specific list of words (delete words). > > > Here is what I am doing but with no result: > > > infile = "messy_data_file.txt" > > out

Re: Python: Deleting specific words from a file.

2011-09-08 Thread Terry Reedy
On 9/8/2011 9:09 PM, papu wrote: Hello, I have a data file (un-structed messy file) from which I have to scrub specific list of words (delete words). Here is what I am doing but with no result: infile = "messy_data_file.txt" outfile = "cleaned_file.txt" delete_list = ["word_1","word_2","wo

Re: Python: Deleting specific words from a file.

2011-09-08 Thread John Gordon
In <30f9b718-bb3c-4c92-8a03-0f760c993...@a12g2000yqi.googlegroups.com> papu writes: > Hello, I have a data file (un-structed messy file) from which I have > to scrub specific list of words (delete words). > Here is what I am doing but with no result: > infile = "messy_data_file.txt" > outfile

Re: Python: Deleting specific words from a file.

2011-09-08 Thread MRAB
On 09/09/2011 02:09, papu wrote: Hello, I have a data file (un-structed messy file) from which I have to scrub specific list of words (delete words). Here is what I am doing but with no result: infile = "messy_data_file.txt" outfile = "cleaned_file.txt" delete_list = ["word_1","word_2","wo

Python: Deleting specific words from a file.

2011-09-08 Thread papu
Hello, I have a data file (un-structed messy file) from which I have to scrub specific list of words (delete words). Here is what I am doing but with no result: infile = "messy_data_file.txt" outfile = "cleaned_file.txt" delete_list = ["word_1","word_2","word_n"] new_file = [] fin=open(infil