Hi it would be great if anyone could help me out with this. I have encountered a requirement in salesforce where I have to upload/insert a custom object record and its related file attachment into salesforce using a single csv file using data loader. So is there any work around to do it ? Thanks in advance.
There's no way to do this without custom development. Data Loader targets exactly one object per data load.
You'd have to build a staging table and automation to transform it into a custom object + attachment, but that's a very bad idea because you'd dramatically limit the size of the attachment you can include due to governor limits.
Abandon the idea of one Data Loader pass. Either do two passes, or script the upload, or use a middleware platform that can transform your inbound data into two API calls.