How to read data from any of the usb ports using the arduino

Strictly speaking the Arduino (Uno or Mega for example) neither knows nor cares what USB port it is connected to.

It is the PC software that has to know what USB port the Arduino is connected to.

...R