Skip to main content
Tweeted twitter.com/StackUnix/status/863374632858120192
added 15 characters in body
Source Link
fugitive
  • 1.6k
  • 22
  • 36

Is there some workaround to join multiple files at once based on the first column? Usually, I would do: join File1 File2 > File1+File2 and File1+File2 File3 > final_output

Example files:

File1:

1 test1
2 test3
3 test4
4 test5
7 test7

File2:

1 example1
2 example2
3 example3
4 example4
8 example8

File3:

1 foo1
2 foo2
3 foo3
4 foo4
10 foo10

Considering that f.e. fifth line may differs in each file, and there is n number of files. Edit:

Example output:

1 test1 example1 foo1
2 test2 example2 foo2
3 test3 example3 foo3
4 test4 example4 foo4

On the other hand, I am not sure how lines that don't match in column1 will be processed (fifth line) Thanks

Is there some workaround to join multiple files at once based on the first column? Usually, I would do: join File1 File2 > File1+File2 and File1+File2 File3

Example files:

File1:

1 test1
2 test3
3 test4
4 test5
7 test7

File2:

1 example1
2 example2
3 example3
4 example4
8 example8

File3:

1 foo1
2 foo2
3 foo3
4 foo4
10 foo10

Considering that f.e. fifth line may differs in each file, and there is n number of files. Edit:

Example output:

1 test1 example1 foo1
2 test2 example2 foo2
3 test3 example3 foo3
4 test4 example4 foo4

On the other hand, I am not sure how lines that don't match in column1 will be processed (fifth line) Thanks

Is there some workaround to join multiple files at once based on the first column? Usually, I would do: join File1 File2 > File1+File2 and File1+File2 File3 > final_output

Example files:

File1:

1 test1
2 test3
3 test4
4 test5
7 test7

File2:

1 example1
2 example2
3 example3
4 example4
8 example8

File3:

1 foo1
2 foo2
3 foo3
4 foo4
10 foo10

Considering that f.e. fifth line may differs in each file, and there is n number of files. Edit:

Example output:

1 test1 example1 foo1
2 test2 example2 foo2
3 test3 example3 foo3
4 test4 example4 foo4

On the other hand, I am not sure how lines that don't match in column1 will be processed (fifth line) Thanks

deleted 48 characters in body
Source Link
John1024
  • 76.4k
  • 12
  • 176
  • 165

Is there some workaround to join multiple files at once based on the first column? Usually, I would do: join File1 File2 > File1+File2 and File1+File2 File3

Example files:

File1:

    File1:
    1 test1
    2 test3
    3 test4
    4 test5
    7 test7
 
    File2:
    

File2:

1 example1
    2 example2
    3 example3
    4 example4
    8 example8

File3:

File3:

1 foo1
2 foo2
3 foo3
4 foo4
10 foo10

Considering that f.e. fifth line may differs in each file, and there is n number of files. Edit:

Example output:

1 test1 example1 foo1
2 test2 example2 foo2
3 test3 example3 foo3
4 test4 example4 foo4

On the other hand, I am not sure how lines that don't match in column1 will be processed (fifth line) Thanks

Is there some workaround to join multiple files at once based on the first column? Usually, I would do: join File1 File2 > File1+File2 and File1+File2 File3

Example files:

    File1:
    1 test1
    2 test3
    3 test4
    4 test5
    7 test7
 
    File2:
    1 example1
    2 example2
    3 example3
    4 example4
    8 example8

File3:
1 foo1
2 foo2
3 foo3
4 foo4
10 foo10

Considering that f.e. fifth line may differs in each file, and there is n number of files. Edit:

Example output:

1 test1 example1 foo1
2 test2 example2 foo2
3 test3 example3 foo3
4 test4 example4 foo4

On the other hand, I am not sure how lines that don't match in column1 will be processed (fifth line) Thanks

Is there some workaround to join multiple files at once based on the first column? Usually, I would do: join File1 File2 > File1+File2 and File1+File2 File3

Example files:

File1:

1 test1
2 test3
3 test4
4 test5
7 test7

File2:

1 example1
2 example2
3 example3
4 example4
8 example8

File3:

1 foo1
2 foo2
3 foo3
4 foo4
10 foo10

Considering that f.e. fifth line may differs in each file, and there is n number of files. Edit:

Example output:

1 test1 example1 foo1
2 test2 example2 foo2
3 test3 example3 foo3
4 test4 example4 foo4

On the other hand, I am not sure how lines that don't match in column1 will be processed (fifth line) Thanks

added 243 characters in body
Source Link
fugitive
  • 1.6k
  • 22
  • 36

Is there some workaround to join multiple files at once based on the first column? Usually, I would do: join File1 File2 > File1+File2 and File1+File2 File3

Example files:

    File1:
    1 test1
    2 test3
    3 test4
    4 test5
    7 test7

    File2:
    1 example1
    2 example2
    3 example3
    4 example4
    8 example8

File3:
1 foo1
2 foo2
3 foo3
4 foo4
10 foo10

Considering that f.e. fifth line may differs in each file, and there is n number of files. Edit:

ThanksExample output:

1 test1 example1 foo1
2 test2 example2 foo2
3 test3 example3 foo3
4 test4 example4 foo4

On the other hand, I am not sure how lines that don't match in column1 will be processed (fifth line) Thanks

Is there some workaround to join multiple files at once based on the first column? Usually, I would do: join File1 File2 > File1+File2 and File1+File2 File3

Example files:

    File1:
    1 test1
    2 test3
    3 test4
    4 test5
    7 test7

    File2:
    1 example1
    2 example2
    3 example3
    4 example4
    8 example8

File3:
1 foo1
2 foo2
3 foo3
4 foo4
10 foo10

Considering that f.e. fifth line may differs in each file, and there is n number of files.

Thanks

Is there some workaround to join multiple files at once based on the first column? Usually, I would do: join File1 File2 > File1+File2 and File1+File2 File3

Example files:

    File1:
    1 test1
    2 test3
    3 test4
    4 test5
    7 test7

    File2:
    1 example1
    2 example2
    3 example3
    4 example4
    8 example8

File3:
1 foo1
2 foo2
3 foo3
4 foo4
10 foo10

Considering that f.e. fifth line may differs in each file, and there is n number of files. Edit:

Example output:

1 test1 example1 foo1
2 test2 example2 foo2
3 test3 example3 foo3
4 test4 example4 foo4

On the other hand, I am not sure how lines that don't match in column1 will be processed (fifth line) Thanks

Source Link
fugitive
  • 1.6k
  • 22
  • 36
Loading