Hi, I have 2 text files the first one is in the following format: CC: "Some statements" ............................................... this is continued for 11-12 lines of variable length. then a line containing the variable names used in the file and then the variable fields with their observations...there are in all 684 observations. The next file is a text file containing 3 variables and 684 observations but are not numbered , I mean 1 to 684. Only th variable values are there along with thew column headers. My target is to merge these 2 text files and create a new text file preserving the format of the first one becos the subsequent steps of the main program uses the format of the first file. I have to create an id variable that numbers the observations from 1 to 684 and then merge th 2 files with that id, because the first one has the id variable numbered from 1 to 684. Please help me to achieve this in R. Regards Chandramouli Banerjee --------------------------------- [[alternative HTML version deleted]]