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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:17:35+00:00 2026-06-09T20:17:35+00:00

I have a rather monolithic database I am re-building at the moment, and I

  • 0

I have a rather monolithic database I am re-building at the moment, and I want to join 3 tables with semi-matching content, I have several sets of these but they all come in groups of three. Here is the situation:

–note all tables are in ascii format, space deliminated —

T1_01= Table 1 =

1 + 'stuff1' + additional content 1  (where additional content only sometimes available)

2  ""

3  ""

....400

T1_02= Table 2 =

1 + "different stuff" + additional content 2

2 ""

3 ""

... 400

T1_03 = Table 3 =

5 cols yet other stuff + 001 + additional content 3

5 cols yet other stuff + 003    ""

5 cols yet other stuff + 007    ""

...

5 cols yet other stuff + 399   some rows are skipped, varies which ones

5 cols yet other stuff + 400

what I want, for each ‘group’ I have 3 tables, since these are grouped in a handy fashion, ie T1_01, T1_02, T1_03 would be table 1,2,3 for group 1, and again for T2_01,T2_02,T2_03. I need to do this about 60 times in total and the table output I am hoping for is:

T1_0123=

1 + 'stuff1' + additional content 1 1 + "different stuff" + additional content 2 5 cols yet other stuff + 001 + additional content 3
2 + 'stuff1' + additional content 1 2 + "different stuff" + additional content 2 "something to fill in the empty spaces, like a set of -99.9 values"
3 + 'stuff1' + additional content 1 3 + "different stuff" + additional content 2 5 cols yet other stuff + 003 + additional content 3
...
400 ""

now I did an initial run and

join -1 1 -2 1 T1_01 T1_02 > T1_012 works great, but only does the first two
and

join -1 1 -2 6 T1_01 T1_03 … does not work since 001 is not 1

and I was hoping to run all 3 tables in a go then do something like
sed something awk $(cat list_of_T01) $(cat list_of_T02) $(cat list_of_T03) to run as a batch job. I have been learning python so this may be possible there as well, but I surely AWK is easier? Any suggestions are welcome.

  • 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-09T20:17:36+00:00Added an answer on June 9, 2026 at 8:17 pm

    Try this one:

    join -1 1 -2 6 <(sed 's/^[0-9] /00&/;s/^[0-9][0-9] /0&/;' T1_01) T1_03
    

    or this one if your delimiter isn’t space:

    join -1 1 -2 6 <(sed 's/^[0-9][^0-9]/00&/;s/^[0-9][0-9][^0-9]/0&/;' T1_01) T1_03
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rather huge query that is needed in several stored procedures, and
I have a rather standard situation where I want to use a templated class
I have a mysql database which has grown to over 200 tables in it.
I have rather large project that uses ICU regex classes. Basically it might run
Have a rather simple question. Does anyone knows if i can use jparallax both
I have some rather odd behavior in my D program that I've narrowed down
I have a rather large text corpus, of which I would like to check
I have a rather simple ListView row: <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=wrap_content
I have a rather complicated lookup for an option. It comes from a separate
I have a rather complicated (and very inefficient) way of getting utilisation from a

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.