Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

In bash script how to merge 2 Multi lines files in one file

I have a file 1 :

ZRFYOK5U
 H8X7IS5G
 8TV7N4BK

And a file 2 :

1
4138
1167

I’d like to merge them so it looks like this :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

ZRFYOK5U;1
 H8X7IS5G;4138
 8TV7N4BK;1167

>Solution :

As mentioned in the comments under the question, paste is pretty straightforward to solve this problem:

paste -d ';' file1 file2

Example:

$  paste -d ';' <(seq 5 ) <(seq 6 10)
1;6
2;7
3;8
4;9
5;10
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading