Do you use raw ECG data or RR-intervals? if ECG, what is the sampling rate? what is the format of your files and what other information are in the files?
Are you going to split data based on sleep stages? note that when you have a long-duration record it may be better to split your data into 5-minutes intervals and run analysis for each interval separately. In this case you can use the ARTiiFACT it has batch operation. But, first you need to extract RR-intervals, and better to do it with Kubios.
What indexes of HRV do you need? if simple time domain and frequency domain indexes are OK then use batch operation of the ARTiiFACT after RR-interval extraction. The standard version of Kubios does not have batch operation.
If you can send me one of your raw data files (anonymous) I may be more helpful.
At the end, visual inspection of the raw signal and detection and correction of artifacts, ectopic beats, etc. is a requirement before HRV analysis and for this Kubios is the best. So, maybe you can save some time by some tricks but you cannot bypass these steps.
Thank you very much for your comments and help, can I ask you what tool do you advise to use to split the recording of the EDF file into time chunks?? I do not have the original PSG. And if through the MATLAB, how can it done?? thank you again for help, really appreciated.