Please become accustomed to provide decent context info of your problem.
It is always helpful to carefully and detailedly phrase a request, and to support it with system info like OS and shell, related environment (variables, options), preferred tools, adequate (representative) sample input and desired output data and the logics connecting the two, and, if existent, system (error) messages verbatim, to avoid ambiguities and keep people from guessing.
Why can't you use paste? It should be a standard Linux command.
This sed script may work with the caveat that I don't guarantee all lines will be pasted (should one file be longer than the other):
printf "%s\n" {a..z} > rightfile
printf "%s\n" {1..26} > leftfile
< rightfile sed 's/\^/\\^/g' | sed '=;s!^!s^$^ !;s!$!^!' | sed 'N;s/\n/\t/' > tmpfile
< leftfile sed -f tmpfile
1 a
2 b
3 c
4 d
5 e
6 f
7 g
8 h
9 i
10 j
11 k
12 l
13 m
14 n
15 o
16 p
17 q
18 r
19 s
20 t
21 u
22 v
23 w
24 x
25 y
26 z
I've written it so you can type
< file
and then paste the rest of the line from the first sed .
No, you didn't make it clear at all, as you can see by the number of people wildly guessing around what the problem is. Why would the paste proposal NOT fulfill your needs, even when "txt is always different"?
You posted the contents of file1 to be one single word, you didn't bother to post an example of file2; the desired output lets conclude it has one single word as well. Will that always be the case?
Why do you need "to do this by line number" - in post#1 it has been defined to be line 1 from file1 to go to the begin of file 2, i.e. line 1. You don't seem to see your requirements clearly yourself...?