Hi Manpreet,
If in a Master-detail relationship, you first need to insert all master records.
Then run a report to get all the Inserted Master record Id’s and export them your machine.
Now to insert detail object records, you need to associate them with Master Record ID.
A possible approcah would be use VLOOkUP function in Excel to populate the Id’s.
Once you have the ID’s populated then you can insert Detail records using data loader.
Whereas
VLOOKUP is an Excel function to lookup and retrieve data from a specific column in table. VLOOKUP supports approximate and exact matching, and wildcards (* ?) for partial matches. The “V” stands for “vertical”. Lookup values must appear in the first column of the table, with lookup columns to the right.
Hope it helps.
Thanks