Velva
Velva

Reputation: 31

UNIX - Simple merging of two files as in the input

Input File1:

HELLO
HOW

Input File2:

ARE
YOU

output file should be

HELLO
HOW
ARE
YOU

My input files will be in one folder and my script has to fetch the input files from that folder and merge all the files as in the above given order.

Thanks

Upvotes: 0

Views: 77

Answers (3)

Vijay
Vijay

Reputation: 67309

cat:

cat file1 file2 >output

perl:

perl -plne '' file1 file2 >output

awk:

awk '1' file1 file2 >output

Upvotes: 0

Sidharth C. Nadhan
Sidharth C. Nadhan

Reputation: 2253

sed '' file1 file2

hope this works fine +

Upvotes: 1

dogbane
dogbane

Reputation: 274878

You can simply use cat as shown below:

cat file1 file2

or, to concatenate all files in a folder (assuming there are not too many):

cat folder/*

Upvotes: 2

Related Questions