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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:05:41+00:00 2026-05-12T06:05:41+00:00

Part of my script is taking values and putting them to a text file

  • 0

Part of my script is taking values and putting them to a text file delimited by tabs. So I have this:

for linesplit in fileList:
    for i in range (0, len(linesplit)):
        t.write (linesplit[i]+'\t')

I get as an output in the file what I expect in the first line but in the following lines they all start with a \t in them, like is:

value1    value2    value3
    value1    value2    value3
    value1    value2    value3

Also, why don’t I need to add a t.write(‘\n’) after the second FOR loop to create the newlines? I would expect the code above to produce one long line of tab separated values but it doesn’t. If I include the t.write(‘\n’) then the tabs issue is resolved but I get double ‘\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-05-12T06:05:41+00:00Added an answer on May 12, 2026 at 6:05 am

    I’m sorry… After I hit submit it dawned on me. My last value already has a \n in it which causes the newline.

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

Sidebar

Related Questions

I have this code (part of bigger script): flashvars.xmlSource = datasource.xml; datasource.xml looks like:
as part of a script i am working on i have the following: loop
I have a build script and as part of that script it copies a
Whenever I run this script the find part executes but the if statement causes
I have a complex Powershell script that gets run as part of a SQL
I'm working on a script, and a small part of that involves taking a
i am using a label <asp:Label ID=lblMessage runat=server Text= BorderStyle=Solid></asp:Label> in script part iam
I've implemented part of this script to help me with debugging var ZFDebugLoad =
I have such part of bash script if [ ! -e $f -o -L
We have a headless selenium running as part of a maven build script using

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.