combine files by line

Hello People.

Been away from applescript for to loong :confused:

Iv’e got two files that I need to combine into one, but line by line

File1.txt :
some_data_here
some_more_data

File2.txt
data_to_append_to_file1
more_data_for_file1

What I need is a file with this output
some_data_here data_to_append_to_file1
some_more_data more_data_for_file1

How do I do that?

A shell script or python would be fine to…

Hope somebody can do a bit of magic.

Thanks.

Thanks alot but I’m getting this error

mkh:~ mkh$ /Users/mkh/Desktop/test.py
File “/Users/mkh/Desktop/test.py”, line 10
joined_file_contents = file1_contents.zip(file2_contents).map { |pair| pair.join(" ") + “\n” }
^
SyntaxError: invalid syntax

Sorry, I should have said it was Ruby. Use an “.rb” extension.

He, thats okay… Got it working, thanks again…