How to deal with replaced files?

My task is to copy all files from many directories in one. The big problem i encounter is that some files in different directory have the same names. Is they are way to copy the files that have same names in a sub directory ( need to preserve the name of the files unchanged )

I have list with all the files i have to copy.
Example

/media/gogo/6651-FEAB/Desktop/Desktop.jpg
/media/gogo/6651-FEAB/Desktop/fatgen103-1.pdf
/media/gogo/6651-FEAB/Desktop.jpg
/media/gogo/6651-FEAB/DOCS/docs slamka/ExpertizaShablon.doc
/media/gogo/6651-FEAB/KARA/docs slamka/Pismo/Desktop.jpg
/media/gogo/6651-FEAB/DOCS/docs slamka/Pismo_Uvedomitelno-Shablon.doc
/media/gogo/6651-FEAB/DOCS/docs slamka/PrPedavane-Shablon.doc
/media/gogo/6651-FEAB/DOCS/original/PrPedavane/Strgoa/Desktop.jpg

I need to copy all the files in:

gogo@okk/home/gogo/Documents/Record

ps: the threat name is wrong if someone na change it to "How to deal with files who have the same name"

Its not possible to have two files with the same name in one directory. One suggestion is, you can append a number to it.
For e.g., you could copy "Desktop.jpg" from different locations as "Desktop01.jpg", "Desktop02.jpg"... and so on...

How can your destination directory hold "two files" with the same name?

Option (1) You have prefix/append extra characters for each duplicate file before copying
(2) Even in Destination directory maintain the directory structure.

Sounds like a mess.

For example. it seems you have at least four copies of DeskTop.jpg so you would need at least three subdirectories to preserve all the files. What are you going to name those subdirectories so you can tell which files are where?

As other poster suggested, you could also append something to prevent duplicate file names. But sounds confusing.

Why do you want to copy all the files together into one directory in the first place? What's the advantage?

If there is a good reason to do this, I'm sure it could be done: Get name of file to copy. Test if file already in destination directory. If no, copy it. If yes, create new subdirectory and copy file to subdirectory instead.

Is they are way to make script that copy the files that have same names in a sub directory :o ?

---------- Post updated at 02:35 AM ---------- Previous update was at 02:28 AM ----------

The advantage is easy access.

What you suggest looks exactly what i am after, but need assist with it: Get name of file to copy. Test if file already in destination directory. If no, copy it. If yes, create new subdirectory and copy file to subdirectory instead

I don't mind copy all the files from the list in a new destination preserving the folder tree as well, but again i need help because don`t know how to preserve the directory tree.

It would help if you could compose a test case. Give a sample of eight or so file names with complete paths, and the final complete paths you want.

Of course it's possible to do most anything. But sometimes the cure is worse than the disease. Why do you want all the files in one directory? The whole point of having directories is to organize information. What would be the result if you took all the papers out of your file cabinet and emptied them onto your desk? :o Is there any chance you could use tar or zip to accomplish whatever you are trying to do?

Well actually the files i need to copy are files i was specifically looking for, and they have something in common, so getting them in the same directory wood not presan an issue.

Here is an example:

/media/gogo/6651-FEAB/Desktop/Desktop.jpg
/media/gogo/6651-FEAB/Desktop/fatgen103-1.pdf
/media/gogo/6651-FEAB/Desktop.jpg
/media/gogo/6651-FEAB/DOCS/docs slamka/ExpertizaShablon.doc
/media/gogo/6651-FEAB/DOCS/docs slamka/Pismo-Shablon.doc
/media/gogo/6651-FEAB/eks/blaaaak/backup/path/map.jpg
/media/gogo/6651-FEAB/DOCS/docs slamka/Pismo_Uvedomitelno-Shablon.doc
/media/gogo/6651-FEAB/DOCS/docs slamka/PrPedavane-Shablon.doc
/media/gogo/6651-FEAB/DOCS/docs slamka/.doc
/media/gogo/6651-FEAB/DOCS/doc/letter.doc
/media/gogo/6651-FEAB/linux/Best Practices v3_1.pdf
/media/gogo/6651-FEAB/linux
/media/gogo/6651-FEAB/linux/logo1.jpg
/media/gogo/6651-FEAB/linux/logo2.jpg
/media/gogo/6651-FEAB/priemo_predav protokol2.doc
/media/gogo/6651-FEAB/tragva/Snapshot-15.jpg
/media/gogo/6651-FEAB/files/leto/21661-Clipart-Picture-Illustration-Of-A-Collection-Of-10-Floral-Vines-And-Flourishes-In-Black-And-White.jpg

/media/gogo/6651-FEAB//Other/Help/images/help_logo_top.png
/media/gogo/6651-FEAB//eks/REGISTRI/Desktop.jpg
/media/gogo/6651-FEAB/eks/blaaak/Blanka Obekt 5 - HP.doc
/media/gogo/6651-FEAB/eks/blaaaak/Blanka Obekt DELL.doc
/media/gogo/6651-FEAB/eks/blaaaak/map.jpg

all this lines are in a file datafinal. Path to this file is:

/home/gogo/Desktop/datafinal

The files i will copy will be always from removable device, hard drive or flash, dunno if this is relevant.

Need the files here:

/home/gogo/Documents/filetumb

Do it anyway you can, all files in one directory with the files who have duplicated names put in a sub directory OR copy all files with they are path in the folder i pointed.