Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: searching contents of files
Post: RE: searching contents of files

I try to read file in list and tried below code its not working.Please help. >>> f=open("a.txt","r") >>> p=open("b.txt","r") >>> disk=[] >>> for line in p: ... ...
Ahmedrhle General Coding Help 12 6,853 Jul-20-2017, 05:22 PM
    Thread: searching contents of files
Post: RE: searching contents of files

I have converted the first file into list as below: >>> f=open("/var/tmp/out1","r") >>> p=open("/var/tmp/input2","r") >>> disk=[] >>> for line in p: ...     line =...
Ahmedrhle General Coding Help 12 6,853 Jul-20-2017, 02:32 PM
    Thread: searching contents of files
Post: RE: searching contents of files

Any hints to process with my code.
Ahmedrhle General Coding Help 12 6,853 Jul-19-2017, 09:50 PM
    Thread: searching contents of files
Post: RE: searching contents of files

Please can you give the code for getting the output.
Ahmedrhle General Coding Help 12 6,853 Jul-19-2017, 09:37 PM
    Thread: searching contents of files
Post: RE: searching contents of files

I tried below code.but of no use. >>> master_file=open("/var/tmp/out1","r") >>> search_results=open("/var/tmp/out2","w") >>> for line in master_file: ... if set(line.sp...
Ahmedrhle General Coding Help 12 6,853 Jul-19-2017, 09:13 PM
    Thread: searching contents of files
Post: RE: searching contents of files

Thank a lot it will be the new file. Sample input files are above in the thread My expected out put will be the word after line number
Ahmedrhle General Coding Help 12 6,853 Jul-19-2017, 08:55 PM
    Thread: searching contents of files
Post: searching contents of files

my question here i have two files a and b.I want to search contents of file a in file b.and the out put to other file which contains only one word after line number.the two files are below: File a: ...
Ahmedrhle General Coding Help 12 6,853 Jul-19-2017, 08:48 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020