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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:19:58+00:00 2026-06-07T02:19:58+00:00

I have 3 tsv files containing different data on my employees. I can join

  • 0

I have 3 tsv files containing different data on my employees. I can join these data with the last name and first name of the employees, which appear in each file.

I would like to gather all the data for each employee in only one spreadsheet.

(I can’t just do copy/past of the columns because some employees are not in file number 2 for example but will be in file number 3).

So I think – I am a beginner – a script could do that, for each employee (a row), gather as much data as possible from the files in a new tsv file.

Edit.
Example of what I have (in reality I have approximatively 300 rows for each file, some emloyees are not in all files).

file 1

     john      hudson     03/03    male
     mary      kate       34/04    female
     harry     loup       01/01    male

file 2

     harry     loup     1200$

file3

    mary     kate     atlanta

What I want :

    column1    colum2    column3     column4    column5    column6
    john       hudson     03/03      male
    mary       kate       34/04      female    atlanta
    harry      loup       01/01      male                 1200$

It would help me a lot!

  • 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-07T02:19:59+00:00Added an answer on June 7, 2026 at 2:19 am

    Use this python script:

    import sys, re
    
    r=[]
    i = 0
    res = []
    for f in sys.argv[1:]:
        r.append({})
        for l in open(f):
            a,b = re.split('\s+', l.rstrip(), 1)
            r[i][a] = b
            if i == 0:
                res += [a]
        i += 1
    
    for l in res:
        print l," ".join(r[k].get(l, '-') for k in range(i))
    

    The script loads each file into the dictionary (the first column is used as a key).
    Then the script iterates through the values of the first column in the first file and
    writes correspondent values from the dictionaries (that were created from the other files).

    Example of usage:

    $ cat 1.txt 
    user1 100
    user2 200
    user3 300
    $ cat 2.txt 
    user2 2200
    user3 2300
    $ cat 3.txt 
    user1 1
    user3 3
    $ python 1.py [123].txt
    user1 100 - 1
    user2 200 2200 -
    user3 300 2300 3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several TSV files ranging in size from 2MB to 450MB. I need
I need to be able to parse both CSV and TSV files. I can't
Have one Doubt In MVC Architecture we can able to pass data from Controller
I have over 125 TSV files of ~100Mb each that I want to merge.
I have a TSV file that consists of integers along with some false data
I have a Perl script using a system call to sort a tsv file:
I have a column with a list of dates in a spreadsheet (.tsv) (some
have written this little class, which generates a UUID every time an object of
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
Have deployed numerous report parts which reference the same view however one of them

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.