How to merge two text files into one file without using cat or sed
Try paste
command :
paste -d';' File1 File2 > File3
#!/usr/bin/awk -f
{
w[FNR][FILENAME] = $0
}
END {
for (x in w)
print w[x][ARGV[1]] ";" w[x][ARGV[2]]
}
I also came up with this, but it fails because of the way Awk iterates arrays:
#!/usr/bin/awk -f
{
w[FNR][FILENAME] = $0
}
END {
for (x in w) {
y = 0
for (z in w[x]) {
printf w[x][z]
printf y ? "\n" : ";"
y = 1
}
}
}