For data processing and further calculations a long format would be more adequate, that would be three columns, file_id, segment and duration. For this you can use tidyr::pivot_longer()
If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.