If the path is same, both the lines should be saved in one file and in different files. [emphasis added]
I don't understand this statement.
Update: I also don't understand why is not possible to provide an exact example of an input file you wish to parse (in <code> tags), less than a dozen lines would seem enough, and also exact examples of the output files produced from the example input file (again, in <code> tags). You've already done the first (maybe — see davido's comments here), so the output files would not seem a much greater step. Please see this. Having exact examples of both input and output might go a long way toward clarifying the situation.
Give a man a fish: <%-{-{-{-<
In reply to Re^3: Copying files from one file to another file
by AnomalousMonk
in thread Copying files from one file to another file
by harishnv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |