and I must copy data using above path from local to remote server:
(to better understand " scp /mnt/infile/20141020/701_0001.png /remote/tmp/pk21730/p0330223723074.png ")
You certainly should not login to node2 10000 times. Create a shell script with all the mkdir s, login, and execute remotely. And, I'd create the entire file and directory structure locally, e.g. while read line ; do echo mv ${line/png\//png \/tmp\/}; done < pod.txt , and then copy that over with one single scp command.
scp offers the -r option to recursively copy directory trees. man scp :
So - create the tree locally, point scp to the tree root, and let it copy all the files including directories.
Do a test with small subset first. It will not work like a greased lightning, but not logging in 10000 time will make it significantly faster.
I think I can't use option -r because e.g file 1 on local server name "701_0001.png" but on remote server it must name "p0330223723074.png" (first of course I must create directory "pk21730")
That's why I proposed to create the entire new structure locally. If it's on the same file system, mv ing files will just modify the directory entries and is very fast. When that is done, copy the entire structure over.