Script to load csv after build

This code works to load up my csv file to load up the world components, but only in the editor when I hit “play” works fine. What it doesn’t do, is if I make a build, it doesn’t load from the csv file. I’ve seen things about Unity’s Streaming Asset path yet I’m not sure how to apply that to my script I have here. Is that even what I need? How I make my csv file loadable after a build?

basePath = Application.dataPath;
basePath += "/Scenes/BoardCSV/Board.csv";
width = height = 0;
string[] rows = System.IO.File.ReadAllLines(basePath);
foreach(string row in rows) {
    ++width;
    string[] columns = row.Split(',');
    foreach (string column in columns) {
        if (width == 1)
            ++height;
     }
}

I fixed it. I used this Unity doc as my resource.

1. Created Resource Paths

It states that Mac and Windows builds have different locations for their resource folders. I used the branches mentioned in that doc by creating each folder individually to re-make each path for both Mac and Windows:
170847-screen-shot-2020-11-11-at-44912-pm.png

2. Updated Code

Then I changed the code a bit to this:

 basePath = Path.Combine(Application.streamingAssetsPath, "Board.csv");
 width = height = 0;
 string[] rows = System.IO.File.ReadAllLines(basePath);
 foreach(string row in rows) {
     ++width;
     string[] columns = row.Split(',');
     foreach (string column in columns) {
         if (width == 1)
             ++height;
      }
 }

3. Added IO Header

Lastly, I had to add “using Unity.IO” as a header file.

Hello there!
I’ve got a question.

I’ve got the next task.

I have text objects in my UI.
They recieve text from .csv file.

But I want to change this .csv file after I build my game. To change the text in the text objects by changing the .csv
Would this script help me with this task?