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

  • Home
  • SEARCH
  • 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 8343995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:14:02+00:00 2026-06-09T06:14:02+00:00

I am very new to python so please bear with me. I have a

  • 0

I am very new to python so please bear with me.

I have a files with atom coordinates. The files look a certain way, but the coordinates are not necessarily on the same line. The file also contains some text, below is a part of the file which is important:

<Gold.Protein.RotatedAtoms>
  28.5571   85.1121    3.9003 C.ar 0  0  0  0  0  0  0  0  0  0  0  0  
  27.3346   84.9085    3.2531 C.ar 0  0  0  0  0  0  0  0  0  0  0  0  
  28.9141   86.4057    4.2554 C.ar 0  0  0  0  0  0  0  0  0  0  0  0
  26.4701   85.9748    2.9810 C.ar 0  0  0  0  0  0  0  0  0  0  0  0 
  28.0456   87.4704    3.9845 C.ar 0  0  0  0  0  0  0  0  0  0  0  0 
  26.8436   87.2569    3.3417 C.ar 0  0  0  0  0  0  0  0  0  0  0  0  
  26.1924   88.0932    3.1196 H   0  0  0  0  0  0  0  0  0  0  0  0   
  27.0510   83.9062    2.9565 H   0  0  0  0  0  0  0  0  0  0  0  0 

what I want to do is the following:
Get the python to recognize if the the number on the 5th row in the 6th column (in our case 3.3417) is more or less than 6. Then, if the value is more than 6 write the FILENAME of the file to a text document. Note that the position of this chunk of information changes in the different files. That is to say, the number 3.3417 is not always on the same row.
Also, all the numbers change all time.

I was thinking that I might loop through the text, scanning for the a line with “Gold.Protein.RotatedAtoms” and then take the 3rd insert on line the line 5 rows down. But how would one do that?

Thanks for your help!

  • 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-09T06:14:04+00:00Added an answer on June 9, 2026 at 6:14 am

    Split all the lines of the text into a list using splitlines().

    Find the index of the line with “Gold.Protein.RotatedAtoms” using the enumerate method and a filter in a list comprehension, something like this:

    index = [index for index,line in enumerate(all_lines) if "Gold.Protein.RotatedAtoms"  in line]
    

    Add 5 to that index to get the line you need from all_lines, use the split() method to split it into tokens, and finally take out the 3rd element with the index operator (3rd element = line.split()[2]).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am very new to programming and Python so please bear with me. I
I am a very new in Python so please forgive me the basic question.
Very new to python and can't understand why this isn't working. I have a
I very new to Python, and fairly new to regex. (I have no Perl
I am very new to python programming and have yet to buy a textbook
I'm very new to Python and I'm sure there is a much easier way
I am very new to Python and I have a json news feed that
I'm very new to Python and just crawling my way through it to accomplish
I am very new to Python. Not learnt classes yet. Using Python 3.2.2. Tried
I'm very new to Python and multithreaded programming in general. Basically, I have a

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.