^
|
|
|
What you mean into rows and columns? string.Split is probably what you want.
That would depend on what the contents of the string are. There’s a lot of different ways you can represent a grid in a string.
i want to be able to call apon 1 csv that has 4 columns and 100+ rows and then take out a certain column from a row
What was wrong with the last thread?
Someone even posted some example script.
It’s string.split…
arrays are difficult… ffs it keeps giving me errors and i have no idea how to structure it…
my current attempt…
using UnityEngine;
using System.Collections;
using System;
public class test : MonoBehaviour {
IEnumerator Start () {
string url = "http://www.decadesband.com/uploads/2/8/0/0/2800976/song_data.csv";
WWW www = new WWW (url);
yield return www;
String [7,2] basic = www.text.Split(new Char [] {',','\n'});
Debug.Log(basic[5,2]);
}
void Update () {
}
}
this also doesn’t work
using UnityEngine;
using System.Collections;
using System;
public class test : MonoBehaviour {
IEnumerator Start () {
string url = "http://www.decadesband.com/uploads/2/8/0/0/2800976/song_data.csv";
WWW www = new WWW (url);
yield return www;
}
public String [7,2] basic = www.text.Split(new Char [] {',','\n'});
Debug.Log(basic[5,2]);
void Update () {
}
}
You havent said what the errors are, they are usually intuitive (enough)
Also, with split, pretty sure you can just do string.Split(‘,’ , ‘\n’) without needing to say its an array
Thisll only give a single dimension array
then count x number, y number of times, and feed that into a new 2d array