read line by line and take a string in line and assign that string to the subsequent line using perl
read file record by record and do transformation to the subsequent record based on above record and write into another file