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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:28:19+00:00 2026-06-02T23:28:19+00:00

i have two files with columns sorted by the value of the first column,

  • 0

i have two files with columns sorted by the value of the first column, and i want to merge them only if the value of the second exists in the first one.

The first file is like this

man01 xxx yyy zzz
man02 xxx yyy zzz
man03 xxx yyy zzz
man04 xxx yyy zzz

The second file

man01 sss
man08 sss

And the desired output is

man01 xxx yyy zzz sss
man02 xxx yyy zzz
man03 xxx yyy zzz
man04 xxx yyy zzz

I tried join but requires values of second file exist in the first one :/

  • 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-02T23:28:20+00:00Added an answer on June 2, 2026 at 11:28 pm

    Join can do this, have you considered the -a option ? It will produce a line for each unpairable file line in a.txt and b.txt.

    join -a1 a.txt b.txt
    
    man01 xxx yyy zzz sss
    man02 xxx yyy zzz
    man03 xxx yyy zzz
    man04 xxx yyy zzz
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two files. file1 has the data like belowing containing only one column.
I have two CSV files which use @ to divide each column. The first
I have two sqlite.db files. I'd like to copy the contents of one column
I have two excel files. Among many columns in both these files, they have
What i have is four comboboxes and two files. If the column matches the
I have two columns in a text file. I read them into Python into
I have a GridView with two columns that have capability to be sorted. After
I have two .csv files containing correlation matrices exported from R. One file contains
I have two CSV files (three columns) which I need to compare and extract
I have two tab delimited files: File 1: 12 rows and 1 column File

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.