How to joint multiple value to 1 files?

HI All

need your help i want joint multiple value from 4 files to 1 files.

example like below :

file 1 :

20:22|303
20:23|287
20:24|318
20:25|307
20:26|315

file 2 :

306
288
319
309
310

file 3 :

304
289
323
311
313

file 4 :

301
281
311
301
318

expectation join files :

time|file1|file2|file3|file4
20:22|303|306|304|301
20:23|287|288|289|281
20:24|318|319|323|311
20:25|307|309|311|301
20:26|315|310|313|318

Thanks for help

regards
Fajar

No attempts / ideas / thoughts from your side? Try

paste -d'|||\n' file[1-4]
20:22|303|306|304|301
20:23|287|288|289|281
20:24|318|319|323|311
20:25|307|309|311|301
20:26|315|310|313|318

Tested on Ubuntu linux 17.10.

{ echo time ; ls -1 file*; } | awk '$1=$1' RS= OFS="|"
pr -t -m -J -S"|" file*
1 Like