[Solved] grep values and re-arranging the file
Try this awk: awk -F'”‘ ‘NR%2{p1=$4;next} {print p1 “https://stackoverflow.com/” $4}’ Test: $ awk -F'”‘ ‘NR%2{p1=$4;next} {print p1 “https://stackoverflow.com/” $4}’ file abc/123abc bac/bac123 cde/cd123 b4u/b4u234 2 solved grep values and re-arranging the file