'file' does not exist in the current context.

I am not sure if I am doing this right as I am new to C#. I am just trying to get it to read a line from the file so I can continue moving forward. It’s a .CSV file and I get the following error:
error CS0103 The name ‘file’ does not exist in the current context.

The file is in the Assets folder. I am using a mac and tried the file with its path “/user/computername/projectname/assets/filename.csv”

//begin code fail
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;

public class ReadCSV : MonoBehaviour
{

// Use this for initialization
void Start ()
{

//I tried adding the path before the filename too but no love
StreamReader sr = file.OpenText(“filename.csv”);
//just trying to read ONE line to get this file to be read, no loop here
string line;
line = sr.ReadLine();
print(line);

}

// Update is called once per frame
void Update ()
{

}

} //end code fail

let me know if you have a better suggestion for implementing this. I had it reading this file fine with a different version but due to my poor version control it just stopped reading the file for some reason.

What is the name ‘file’ supposed to refer to?

a flat unicode 8 .csv file

Right, but in your code, the symbol ‘file’ has to refer to a type or a variable or something. What is it intended to refer to?

As the error says, the name “file” doesn’t exist in the current context. i.e, it’s an undeclared variable. You meant File (as in System.IO.File).

–Eric

omg okay now I know what I did wrong. thanks Eric!