I need to read a list of names from different files using python and produce the list of names that appear the first time from each file. Help!!
Abdullah_17
0
Newbie Poster
Recommended Answers
Jump to Post@Sue_2 You can improve this by opening the ouput file only once. Also, you can use fileinput to iterate over the lines of many files
with open('merge_BLASTP_results.out', 'w') as f: for line in fileinput.input(glob.glob('/Users/sueparks/BlastP_Results/*')): f.write(line) # write lines to new file
Also
*
may be a …
Jump to PostWell, you can use
P_1*.txt
to work only with these files. For therna
files, you can userna*.txt
or simplyrna*
if only.txt
files start with this prefix.Note that if you know regular expressions (the re module), you can get a regular …
All 7 Replies
ddanbe
2,724
Professional Procrastinator
Featured Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
Sue_2
0
Newbie Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
Sue_2
0
Newbie Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
Sue_2
0
Newbie Poster
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.