Joined: 11/4/2013(UTC) Posts: 18
|
Hi guys,
Delta Engine is able to read CSV (comma separated values) files? There are a lot of libraries around the web for it, but i don't want to use any external libraries with Delta, to ensure portability. Thank you in advance.
Max
|
|
|
|
Medals:  Joined: 8/24/2011(UTC) Posts: 138 Location: Hannover
Thanks: 1 times Was thanked: 12 time(s) in 7 post(s)
|
No, the Engine just has build-in support for XML and Json. However, I think the real thing you want to do is creating your own ContentType that use CSV as data-source. Our editor guy will write a tutorial next week how to do this. |
|
|
|
|
Joined: 11/4/2013(UTC) Posts: 18
|
Thank you very much for the help
|
|
|
|
Medals:  Joined: 8/20/2011(UTC) Posts: 1,421 Location: Hannover
Thanks: 18 times Was thanked: 97 time(s) in 92 post(s)
|
This sounds quite easy, maybe just use File.ReadAllLines(textFile) and then split each line with .Split(new[] { ',' }). Of course integrating it as ContentData is more safe and allows you to switch to Xml or Json without having to change your code, plus it will work on all platforms.
|
|
|
|
Joined: 11/4/2013(UTC) Posts: 18
|
Thanks Benjamin, my worries comes just from the requirement to design a portable solution. I will wait the new tutorial about custom content with Delta 1.1
|
|
|
|
Medals:  Joined: 8/20/2011(UTC) Posts: 1,421 Location: Hannover
Thanks: 18 times Was thanked: 97 time(s) in 92 post(s)
|
While File.Open from \Content folder is not supported on non windows platforms, we can easily add support for it, reading text files is always possible on all platforms :)
But lets see what solution our editor guy comes up with.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.