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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:41:45+00:00 2026-06-06T12:41:45+00:00

I had to add a column on a text file (edit with Notepad++ on

  • 0

I had to add a column on a text file (edit with Notepad++ on Windows), adding an incremental counter.

I’ve wrote my bash-awk script on Ubuntu and used it on the text file imported from Windows. It works fine, but the new column is on a newline and not near other columns.

Even if I pipe sed 's/\r\n//g' the column is on a newline.

Could this be a problem over the different handle on the newline between Unix and Windows or something is wrong with my sed instruction?

Thanks

  • 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-06T12:41:46+00:00Added an answer on June 6, 2026 at 12:41 pm

    If your file looks something like this:

    col1 col2
    col3
    col1 col2
    col3
    

    Use this to append alternating lines and remove the carriage return:

    sed 'N;s/\r\n/ /'
    

    The result will look like:

    col1 col2 col3
    col1 col2 col3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had to add a new column to my table so I did that
I had a table modified to add status column to it in this fashion
OK i am really struggling with this! I know had to add an image
I had to maunally add some html within the sidebar div of html, but
I had only one function to Add another row to the table id=tblOtherParties and
We had the Power Commands for Visual Studio 2008 that add a context menu
Had a page that was working fine. Only change I made was to add
Had this working; at one stage. The problem is the following text is now
I finally wrote a script to get Google Analytics data then insert it into
I'm pretty new to SQLite 3 and just now I had to add 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.