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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:33:59+00:00 2026-05-23T11:33:59+00:00

I have a xml file from a page which shows correctly on the text

  • 0

I have a xml file from a page which shows correctly on the text editor but once I use readlines(), I only get one line. I assume this means the line separator being used isn’t recognized by python but it is by gedit.

I want to do a split() on it to get the data correctly but how can I see what line separator is being used in the file?

  • 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-05-23T11:33:59+00:00Added an answer on May 23, 2026 at 11:33 am

    As is pointed out in the comments, if it’s xml, just hand it to an XML parser like ElementTree or lxml. Newlines shouldn’t matter in XML.

    For information, using open("thefile.xml", "rU") will open it with universal newline support, so Python will recognise \n, \r or \r\n as newline markers.

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

Sidebar

Related Questions

I am attempting to load each url in a sitemap.xml file in an effort
Let's first get to an important note about my situation: I have 1 table
I am having an issue with creating an XLSX document with the Open XML
I'm trying to get my AJAX call working with the rails 3, but I'm
<?xml version=1.0 encoding=UTF-8?> <form:Documents xmlns:form=http://www.abbyy.com/FlexiCapture/Schemas/Export/FormData.xsd xmlns:addData=http://www.abbyy.com/FlexiCapture/Schemas/Export/AdditionalFormData.xsd> <_Document_Definition_1:_Document_Definition_1 addData:ImagePath=C:\POC\Export\Test.pdf xmlns:_Document_Definition_1=http://www.abbyy.com/FlexiCapture/Schemas/Export/Document_Definition_1.xsd> <_Page_1> <_First_Name>John</_First_Name> <_Last_Name>Doe</_Last_Name> </_Page_1> </_Document_Definition_1:_Document_Definition_1>
I am using php to read a file (specified by a cookie on the
I have created a chrome extension for the company I work for, and want
wonder if anyone can help. Bascially I'm working on a site, and a chunk
There are cases where shipping javascript code with your flash video is not an
I am using an API (Let's pretend its facebook) to gather data between two

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.