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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:39:39+00:00 2026-06-18T06:39:39+00:00

I have two files, note that I’d like to use the last column like

  • 0

I have two files, note that I’d like to use the last column like a reference:

1) First file:

[robert@10-2Fontes]$ head rxid 
0.086297     id 0    udp    767     0
0.091866     id 1    udp    760     1
0.097236     id 2    udp    733     2
0.103616     id 3    udp    869     3
0.110956     id 4    udp    1000    4
0.459247     id 9    udp    754     54

Note: this file have 64196 lines.

2) Second File (reference):

[robert@10-2Fontes]$ head pumba.txt 
0.086297 0
0.091866 1
0.097236 2
0.103616 3
0.110956 4
0.118285 5
0.125615 6
0.130077 7
0.459247 54

This file is a index and have 64677 lines,

3) I would like a 3rd file, where it search the correspondent number in file 2 and put the number related in the last column of the first file. Something like that:

0.086297     id 0    udp    767     0 0.086297
0.091866     id 1    udp    760     1 0.091866
0.097236     id 2    udp    733     2 0.097236
0.103616     id 3    udp    869     3 0.103616
0.110956     id 4    udp    1000    4 0.110956
...
  • 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-18T06:39:41+00:00Added an answer on June 18, 2026 at 6:39 am

    how about:

    awk 'NR==FNR{a[$2]=$1;next}$6 in a{print $0,a[$6]}' file2 file1 > file3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two files in use. The first is a front end select box
I have two files client.php and server.php. The client file send a HTTP request
I have two files: domainList and config.cnf. The domainList file simply has a list
I have two files A - nodes_to_delete and B - nodes_to_keep . Each file
I have two files: allinfo.txt and chr1.txt. allinfo.txt looks like rs4477212 1 82154 A
Say that I have two CSV files (file1 and file2) with contents as shown
I have two nib files, one that will open at startup and another that
I have two .m files. The first is the main code, The second is
I have two select boxes like so: <select id=one> <option value=default>Select File</option> <option value=path/to/file1>File
I have two .c files and one .h file included from them both. In

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.