can you open .doc or .fa in python? or how do i transfer this data to python?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lel7lel7
    New Member
    • Mar 2010
    • 12

    can you open .doc or .fa in python? or how do i transfer this data to python?

    Hi,

    I am struggling to analyse a 100,000KB dna sequence file in word.... it keeps trying to 'repaginate' and freezes....

    Is there anyway i can open this data in python so i can analyse it? I have it in .fa format and in .doc

    Thanks in advance to anyone who can help :)
    Lesley
  • Glenton
    Recognized Expert Contributor
    • Nov 2008
    • 391

    #2
    Try this on you .fa:

    Code:
    myFile=open("YOURFILENAME.fa")
    
    for n,i in enumerate(myFile):
        print n,i
        if n>=10: break
    This will print the first 10 lines and hopefully tell you what's possible. Of course it's possible that it's all one big line! In which case it gets more interesting!!

    Comment

    • woooee
      New Member
      • Mar 2008
      • 43

      #3
      Antiword will convert to a text file (I'm assuming that is latin-1). It is available for most operating systems. Don't know which OS you are using, so can't point to the specific page for the OS http://www.winfield.demon.nl/#Windows

      Comment

      Working...