Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8162069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:37:50+00:00 2026-06-06T18:37:50+00:00

I was able to write some code with the help of the community here,

  • 0

I was able to write some code with the help of the community here, but I am having a problem where my python runs through the iterations and writting out really really slow as apposed to my other script that does the same exact thing but that one ran super fast, is there anything noticeable in this code that might be causing that?

with open('c:/file.sql') as inf, open('c:/file.txt','w') as outf:
    for i in xrange(47):
        inf.next()       

    for line in inf:
        data = line.split(',')
        if len(data) < 15:
            inf.next()
        elif len(data) > 35:      
            hash = data[13]
            select = hash[3:len(hash)-1]
            outf.write(select + '\n')
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T18:37:50+00:00Added an answer on June 6, 2026 at 6:37 pm

    smaller version of your code:

    from itertools import imap, islice
    with open('c:/file.sql') as inf, open('c:/file.txt','w') as outf:
        for line in imap(str.strip, islice(inf, 47, None)):
            data = line.split(',')
            if len(data) > 35:
                hash = data[13]
                select = hash[3:-1]
                outf.write(select+'\n')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write some code to help unit test WCF services. These services
Users will be able to write some documents. Those documents will consists of chapters
I am beginner with Java, and I would like to write some code like
every one i have a problem with my plist ,i was able to write
I'd like to write some code which looks at a website and its assets
I'm trying to write some absolutely barebones code where I can drag a plain
I need some help. I am completely stumped. I'm trying to write my own
I write code in isolation, that is I work for myself. I need some
I'm trying to write a bookmarklet to help some QA testers submit useful debugging
How can I write reflection code that goes through my project and looks for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.