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

The Archive Base Latest Questions

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

Possible Duplicate: merge two files by key if exists in the first file /

  • 0

Possible Duplicate:
merge two files by key if exists in the first file / bash script

I am trying to think of good way to combine these two selections of text (these are example of text that is in a similar format that I would be working on), based on the number prefacing the colon. This would be done in a bash environment, I’ve tried thinking of ways in which I could do it using cut along with other commands, but I have not been able to come up with anything that would work.

selection 1
1:829ede2828e9
2:893h8ew9nediucn
3:mdheuwe883ud8932

selection 2
1:stack
2:over
3:flow

the output would be something along the lines of

1:stack:829ede2828e9
2:over:893h8ew9nediucn
3:flow:mdheuwe883ud8932

so it would essentially be combining and matching the files based on the number prefacing the colon. This code would be used to process around 39,000 lines of text. I am stumped at this point in time so I would really appreciate any help I can get, thanks! also forgot to mention the numbers wont be consistent (1,3,4,5,9,11,22 for example), although both files/sets of text will have the same set of numbers.

  • 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-13T12:45:24+00:00Added an answer on June 13, 2026 at 12:45 pm

    You can use join like this:

    join -t: selection2.txt selection1.txt
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Merge Two Video files in iPhone Application I have download 40mb video
Possible Duplicate: Best way to merge two maps and sum the values of same
Possible Duplicate: merge Audio files on iPhone I'm trying to combine 2 audio files
Possible Duplicate: What is the best method to merge two PHP objects? I have
Possible Duplicate: Simplest way to profile a PHP script We are building this online
Possible Duplicate: Merge two lists in python? How can I prepend list elements into
Possible Duplicate: How can I merge two MySql tables? I want to merge multiple
Possible Duplicate: How can I merge properties of two JavaScript objects dynamically? I have
Possible Duplicate: Merge two rows in SQL I have the following values in table:
Possible Duplicate: How to merge two arrays in Javascript Let's suppose I have 2

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.