I have SD card which has single file in txt format and this card is connected to arduino mega. I want to copy this file to my PC/laptop. What is the way to transfer it from SD card to PC, where SD card remain connected with arduino mega? Or should I ask is there any way or not?
Look into Bluetooth to Bluetooth file transfer.
It should be doable.
What is the way to transfer it from SD card to PC, where SD card remain connected with arduino mega?
Open the file. While not at the end of the file, read one character and write that character to the serial port. Close the file.
Of course, some application has to be listening to the serial port and has to know what to do with the data that it reads.
The DumpFile example included in the IDE should be all you need. This is a common procedure in datalogging, and there is no need to winkle out the SD card. The entire file is simply sent over serial to a proper terminal programme like RealTerm. Several files can be sent as demanded to be held in the one file in the terminal. All the traffic is recorded therein in both directions, so there is no problem sorting out which file is which later.
All you need to do is listen for a serial input in the loop, and use that to go to the dump subroutine.