I also asked this question in this StackOverflow post (where I am more likely to actually see an answer, because I am not checking this site or my related e-mail very often):
I don't seem to be able to add textual data (e.g. in CSV, JSON or XML files) to the Roblox DataModel
, Workspace
, ServerStorage
or anywhere really?
Any hints on how to do this efficiently? Ideally, Roblox should just give me the contents of the file as a table. But if there is a way to get a raw string from a file that I have to parse manually, I could cope, too.
Unfortunately, there is no file format other than scripts for text. However, Lua has a nice way to create multiline literals:
[[Hello World! This is a multiline string literal Neat eh?]]
So you could just copy paste the text file directly into a Roblox script. I suggest using a Module script as you could do something like this to conveniently retrieve the string:
return function() return [[ This is where the text would go ]] end
-- Given the module is named ModuleScript and is parented to workspace local text = require(game.Workspace.ModuleScript)()