Forum Discussion
SRAI
4 years agoNew Contributor III
Importing a CSV file from from Documents/Public/xyz folder to OneStream Cube
Hi,
I have a requirement to import a Cell Details CSV file into OS. My questions are as below:
1. Can we import a CSV file from Documents/Public/xyz folder to OneStream Cube? I tried it but it di...
- 4 years ago
Try this
Dim fileName As String = "CellDetails.csv" Dim usrfile As XFFileEx = BRApi.FileSystem.GetFile(si, FileSystemLocation.ApplicationDatabase, "Documents/Public/" & fileName, True, True) Dim fileBytes As Byte() = usrfile.XFFile.ContentFileBytes File.WriteAllBytes($"{BRApi.Utilities.GetFileShareFolder(si, FileShareFolderTypes.ApplicationIncoming, Nothing).Replace("Incoming", "")}DataManagement\Export\{StringHelper.RemoveInvalidNameCharacters(si.UserName, False, False)}\{fileName}", fileBytes)
ckattookaran
4 years agoValued Contributor
Try this
Dim fileName As String = "CellDetails.csv"
Dim usrfile As XFFileEx = BRApi.FileSystem.GetFile(si, FileSystemLocation.ApplicationDatabase, "Documents/Public/" & fileName, True, True)
Dim fileBytes As Byte() = usrfile.XFFile.ContentFileBytes
File.WriteAllBytes($"{BRApi.Utilities.GetFileShareFolder(si, FileShareFolderTypes.ApplicationIncoming, Nothing).Replace("Incoming", "")}DataManagement\Export\{StringHelper.RemoveInvalidNameCharacters(si.UserName, False, False)}\{fileName}", fileBytes)
- SRAI4 years agoNew Contributor III
Thanks Celvin. It works. A lot to learn 🙂
- IBK2 years agoNew Contributor III
Hi Celvin,
I have seen many videos of yours and Thanks for the abundance of information you provide. We are running into a strange issue where we have .csv files to load and when we come across certain formats it just dosent get loaded into a table in OneStream. In the sql table I have it as a varchar but whatever I do the data for the columns dont get loaded.
Any help would be appreciated,
Thank You,
Indu
Related Content
- 2 months ago
- 4 months ago