I want to migrate the data from confluence to Sharepoint. I do know about the 3rd party software but looking for any different method or procedure. Thanks.
I cannot answer about Confluence as I don't have experience with it. But it should be feasible.
In SharePoint you can use PowerShell to interact with it. So as long you can export the data from confluence in a format that is consumable by PowerSHell you will be able to script the import.
If you have a list you could export it to coma separated csv and import it to Sharepoint. Bare in mind that before export you will need to create a structure for it (ie list) with necessary columns. That can be done from UI or PowerShell as well.
If the effort is worth it dependes on the amount of data you need to migrate. If you have hundredths of lists with different structures you probably better off buying of the shelf product to migrate. If its just few lists or all lists have same structure than scripting can save you few bucks.
For exporting from confluence to csv or xml files best to ask question on vendor forum.