file editing

hi experts,

please help me in writting the script..

i have two files file1 and file 2

i have to write a script which will take input parameters as file1 and file2

file1:
......
1
2
3
4
file2:
.....
1
2

output
........

1 file2
2 file2
3 ......
4 ......

the output must be stored in another file (either .doc or .xls)

thanks in advance

subhendu

Your requirements are not clear.

What have you tried so far? Where are you stuck?

i am trying to make it more clear

while executing the script from the command line it will take two parameters.

lets say file1 and file2

contents of file1 and file2 are

in those files data stored in columns

lets say file1 and file2 contains names as
file1
-----
1
2
3
4

file2
-----
1
2

hence the output will be

output
------
1 file2
2 file2
3 .....
4 .....

means it will search the names present in file2 in file1..

if the names presnt in file1
then it will print the file name against the names present in file1
and will put blank for other names present in file1.

It sounds like homework, let us see what you have tried so far?

just give me some idea so that i can proceed..i dont have much experience in shell scripting. but its my project requirement..

Try using awk. Search the forums for FNR==NR (or NR==FNR) and the posts you find should give you some ideas.

So I was right while making a guess that its a school/homework thing.