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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:01:04+00:00 2026-06-01T19:01:04+00:00

I have file.txt 3 columns. 1 A B 2 C D 3 E F

  • 0

I have file.txt 3 columns.

1 A B
2 C D
3 E F

I want to add #1&#3 as the end of #2. Result should look like this:

1A
2C
3E
1B
2D
3F

I am doing this by

cut -f 1,2 > tmp1
cut -f 1,3 > tmp2
cat *tmp * > final_file

But I am getting repeated lines! If I check the final output with:

cat * | sort | uniq -d

there are plenty of repeated lines and there are none in the primary file.

Can anyone suggest other way of doing this? I believe the one I am trying to use is too complex and that’s why I am getting such a weird output.

  • 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-01T19:01:05+00:00Added an answer on June 1, 2026 at 7:01 pm
    pzanoni@vicky:/tmp$ cat file.txt 
    1 A B
    2 C D
    3 E F
    pzanoni@vicky:/tmp$ cut -d' ' -f1,2 file.txt > result
    pzanoni@vicky:/tmp$ cut -d' ' -f1,3 file.txt >> result
    pzanoni@vicky:/tmp$ cat result 
    1 A
    2 C
    3 E
    1 B
    2 D
    3 F
    

    I’m using bash

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

Sidebar

Related Questions

I have this file file.txt which I want to split into many smaller ones.
I have 600 tab-delimited .txt files that look like this: barcode gene.symbol value 1
I have a txt file with columns separated by tabs and based on that
I have a file temp.txt, that I want to sort with the sort command
I have a file template.txt which contains the following: Hello ${something} I would like
I have a file (dictionary.txt) with data field entries as follows - ABC This
Hi I have a file like this: probeset_id submitted_id chr snp_pos alleleA alleleB 562_201
I have a file like this: n A B C D 1 01 02
I have a tab-delimited text file. I have split this into columns. Each of
Let's say I have a file like this (pretend it were a matrix): abcde

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.