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 8194785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:56:10+00:00 2026-06-07T04:56:10+00:00

I am very new at programming. I have the following problem. I want to

  • 0

I am very new at programming. I have the following problem.

I want to take some floats from a .txt file, and add them to a Python list as strings, with a comma between them, like this:

.TXT:
194220.00   38.4397984  S   061.1720742 W   0.035
194315.00   38.4398243  S   061.1721378 W   0.036

Python:

myList = ('38.4397984,061.1720742','38.4398243,061.1721378')

Does anybody know how to do this? Thank you!

  • 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-07T04:56:10+00:00Added an answer on June 7, 2026 at 4:56 am

    There are three key pieces you’ll need to do this. You’ll need to know how to open files, you’ll need to know how to iterate through the lines with the file open, and you’ll need to know how to split the list.

    Once you know all these things, it’s as simple as concatenating the pieces you want and adding them to your list.

    my_list = []
    with open('path/to/my/file.txt') as f:
        for line in f:
            words = line.split()
            my_list.append(words[1] + words[3])
    print mylist
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to programming and I have the following problem. I have a class
I am very new to programming, and have been following a C++ tutorial for
I am very new to python programming and have yet to buy a textbook
I'm very much new to programming and have been doing fairly well so far.
I am very new to C++ programming and you will see why. I want
I'm new to OS X programming but generally liking it. I have the following
I'm very new to Python and multithreaded programming in general. Basically, I have a
I'm very new to iPhone programming, and I'm currently following tutos to understand the
I am very new to Android programming, and I have read everywhere and I
I have an assignment from my programming class, which is very poorly worded... The

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.