Hi karolus,
Thanks… Finally I Write the Code in LibreOffice - BASIC Macro… i got Some reference from Internet Including " ask.LibreOffice.org " … and Combine them into Macro…
1), First ListOut or get -All File Names in Calc Sheet
In Calc Sheet Column F3 → has Folder Path → E:\New folder
Column A2 → have All The File Names , that is Source FileNames are ListedOut through Macro
If already FileNames are there then, Macro Clears The All File Names in Column A2 To LastRow Of Column A and then Macro getting All the FileNames in the E:\New folder again in the Calc Sheets.
In Column B , Row 2 ( B2 ) to End Of Column B -have the New File Names are Listed Out …
Here is the Screen Shots

Here is the BASIC Macro Codes…
Sub Rename_AllFiles
Dim oSheet As Variant, oCursor As Variant, nEndRow As Long, i As Long
Dim oCellRangeByPosition As Variant, oDataArray As Variant
Dim sPath As String, sSourceName As String, sTargetName As String
oSheet = ThisComponent.getCurrentController().getActiveSheet()
sPath = oSheet.getCellRangeByName("F3").getString()
If Right(sPath, 1) <> GetPathSeparator() Then sPath = sPath + GetPathSeparator()
Call GetFileNames_In_CalcSheets ' get FillNames or List Of FileNames in Calc Sheet
oCursor = oSheet.createCursor()
oCursor.gotoEndOfUsedArea(True)
nEndRow = oCursor.getRangeAddress().EndRow
oCellRangeByPosition = oSheet.getCellRangeByPosition(0, 1, 1, nEndRow)
oDataArray = oCellRangeByPosition.getDataArray()
Dim oFromFile
Dim oToFile
Dim oFromURL
Dim oToURL
For i = 0 To UBound(oDataArray)
sSourceName = oDataArray(i)(0)
sTargetName = oDataArray(i)(1)
oFromFile = sPath + sSourceName
oToFile = sPath + sTargetName
oFromURL = ConvertToUrl(oFromFile)
oToURL = ConvertToUrl(oToFile)
If FileExists(oFromURL) Then
If NOT FileExists(oToURL) then
Name oFromURL As oToURL
Else
MsgBox(oToFile & "Already Exists", 0, "Caution !!")
Exit Sub
End If
Else
MsgBox( oFromFile & " Does Not Exists ", 0, "Caution !!")
Exit Sub
End If
'If Not FileExists(sPath + sSourceName) Then
'MsgBox("File " + sSourceName + " not found",0,"Skipped")
'ElseIf FileExists(sPath + sTargetName) Then
'MsgBox("File " + sSourceName + " already exists",0,"Skipped")
'Else
'Name sPath + sSourceName As sPath + sTargetName
'EndIf
Next i
End Sub
Sub GetFileNames_In_CalcSheets
Dim oSheet As Object, i As Long, iCounter As Long, stFileName As String, stPath As String
Doc = ThisComponent
Sheet = Doc.Sheets(0)
Cell = Sheet.getCellByPosition(5,2) ' F3 --> File Fath--> E:\New folder
oSheet=ThisComponent.CurrentController.ActiveSheet
Print Cell.String ' E :\New folder
Print getPathSeparator() ' \
stPath = Cell.string & GetPathSeparator() ' E:\New folder\
stFileName = Dir(stPath, 0) ' Accessing 0 For File : 16 For Folder
'This "For loop"" Clears Column A,Row 2 through 15'
For i = 1 to 15
'Change here if Column,Row of files is different - i is Row'
oSheet.getCellByPosition(0,i).String = ""
Next i
i = 0
' This Do While Loop will help getFille Names from Fol
Do While (stFileName <> "")
iCounter = iCounter + 1
'File Names will start in Column 'A' (Signified by 0) Row 2 (iCounter)'
oSheet.getCellByPosition(0,iCounter).String = stFileName
stFileName = Dir()
Loop
End Sub
Here is the Screen Shots Of Calc Sheet and Column A , Colum B and Column F



Here is the Screen Shot Of E:\New folder\ ( All the Video Files ) Before (Re-Naming or RunningMacro)

Here, is the Screen Shot Of - After Running Macro… Now, All The Files are Renamed

Here is the Calc Sheet For learning Purpose …
Re-Naming Files.ods (32.3 KB)
For Learning Purpose …Here is the ListOut or Getting All the FileNames in Calc Sheet Macro Codes…
Sub list_files_Method_1() ’ Do While Loop
Dim i, strFile
path ="E:\New folder\"
strFile = Dir(path,0)
i = 1
Do While strFile <> ""
my_cell = ThisComponent.Sheets(0).getCellbyPosition(1,i)
my_cell.String = strFile
strFile = Dir ' returns next entry
i = i + 1
Loop
End Sub
'===========================================================================
Sub list_files_Method_2() ’ Do Until Loop
Dim i, strFile
path ="E:\New folder\"
strFile = Dir(path,0)
i = 1
Do Until strFile = ""
my_cell = ThisComponent.Sheets(0).getCellbyPosition(1,i)
my_cell.String = strFile
strFile = Dir ' returns next entry
i = i + 1
Loop
End Sub
'===========================================================================
Sub list_files_Method_3() ’ While Wend …
Dim i, strFile
path ="E:\New folder\"
strFile = Dir(path,0)
i = 1
While strFile <> ""
my_cell = ThisComponent.Sheets(0).getCellbyPosition(1,i)
my_cell.String = strFile
strFile = Dir ' returns next entry
i = i + 1
Wend
End Sub
'===========================================================================
Macro Code For Re-Name Files
Sub oFileRename
Dim oFromFile : Dim oToFile : Dim oFromURL : Dim oToURL
oFromFile = "E:\New folder\SaveTube.App-LibreOffice Base (26) Limit Distinct Calculations and Constants-(1080p).mp4"
oToFile = "E:\New folder\LibreOffice Base (26) Limit Distinct Calculations and Constants-(1080p).mp4"
oFromURL = ConvertToUrl(oFromFile)
oToURL = ConvertToUrl(oToFile)
If FileExists(oFromURL) then
If NOT FileExists(oToURL) then
Name oFromURL As oToURL
else
MsgBox(oToFile & "Already Exists", 0, "Caution !!")
Exit Sub
End If
else
MsgBox( oFromFile & " Does Not Exists ", 0, "Caution !!")
Exit Sub
End If
End Sub