I know this may not be the correct place but I'm hoping that someone out there will have the knowledge that I'm lacking. I'm on a bit of a deadline so I'm casting many lines out there...
I have written a very small piece of script that runs on our oracle linux server. Unfortunately I found out too late that it was a Linux machine and the vbs script that i've written won't work. Java will work, but I know no nothing about Java and it took me long enough to scrape together these few lines.
The purpose of this is to save the output csv from Oracle OBIEE and copy it to a specific location. Once there, it needs to read the first cell in the csv document and rename the file based on that field.
Can someone help me to convert this to Java?
' Section 1 to save OBIEE report to specified location
' sBasePath = "\\wkse13p1xcboapp01\opt\openbet\logs\campaign_ui\upload\"
sBasePath = "\\coral\public\users\Christy.O'Connor\"
Set objFSO = CreateObject("Scripting.FileSystemObject")
' Parameter 0 is the original file created by OBIEE
sFileName = sBasePath & "output_" & Parameter(0)
objFSO.CopyFile Parameter(0), sFileName, True
Set objFile = Nothing
Set objFSO = Nothing
' Section 2 to rename file based on 1st entry in csv file
Const ForReading = 1
Dim objFolder, objFiles
Dim tsFile, sLine, fields, sNewFilename
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFso.GetFolder(sBasePath)
Set objFiles = objFolder.Files
For Each objFile In objFiles
If objFile.Name = "CampaignUsers2.csv" Then
Set tsFile= objFso.OpenTextFile(objFile.Path, ForReading)
sLine = tsFile.ReadLine 'get 1st record
fields = Split(sLine,",")
sNewFilename = fields(0) 'get 1st field
'Rename file (or use objFile.Copy to copy it)
objFile.Move objFile.ParentFolder & "\" & sNewFilename & ".csv"