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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:23:15+00:00 2026-06-15T00:23:15+00:00

I need to create a file from two input files using linux command input

  • 0

I need to create a file from two input files using linux command

input 1:

21 33210001 rs60180678 G T 100 PASS AVGPOST=1.0000;RSQ=0.9885;THETA=0.0002;AA=G;AN=2184;VT=SNP;LDAF=0.0019;SNPSOURCE=LOWCOV;AC=4;ERATE=0.0003;AF=0.0018;AFR_AF=0.01 GT:DS:GL

input 2:

21 33210001 . G T . . ;AA=0.0163934;AFE=0;ASNE=0;EUN=0;AFW=0.0113636;MED=0;LAT=0;VT=SNP;AF=0.0018

expected output:

21 33210001 rs60180678 G T . . ;AA=0.0163934;AFE=0;ASNE=0;EUN=0;AFW=0.0113636;MED=0;LAT=0;VT=SNP;AF=0.0018

Each coloumn is separated by tab space.

Creating the output based on 1st,2nd,4th and 5th column match .

Each column of out file is separated by tab space.

  • 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-15T00:23:16+00:00Added an answer on June 15, 2026 at 12:23 am

    Here’s one way with awk:

    awk 'BEGIN { FS=OFS="\t" } FNR==NR { a[$1,$2,$4,$5]=$3; next } ($1,$2,$4,$5) in a { $3=a[$1,$2,$4,$5] }1' file1 file2
    

    Results:

    21 33210001 rs60180678 G T . . ;AA=0.0163934;AFE=0;ASNE=0;EUN=0;AFW=0.0113636;MED=0;LAT=0;VT=SNP;AF=0.0018
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create a batch file which will copy web log files from
i need to create a object Image from import javax.microedition.lcdui.Image; using a file .png
I need to take an XML file and create multiple output xml files from
I have a one-time need to create a file from an iOS mutable array.
I need to create an ANSI text file from an Access recordset that outputs
I need to create a PDF or Word file filled with contents from my
Need help to convert code from asp control to input type to fetch file
I need to read in two large files (over 125 MB). Each file contains
I need to create file sharing and chatting system like Microsoft Groove under .NET
We need to create a file management interface that integrates with the clients current

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.