G
Guest
just as the subject states, I need to find a way to read each line from a
multiline variable without having to write the string out to a file so I can
stream it in and use ReadLine(). Below is a snippet of code where I am trying
to read the string that has been passed into the function.
//source is the string of data to parse out
//nodes is the Xml Node Name in the mappingFile
("/Meters/Ion/Report/Field")
//ReadLine indicates whether to process line by line, or read as
continuous string
public List<List<Fields>> GetNodeData(string source, string node,
Boolean ReadLine)
{
//Get the field mappings.
List<Fields> record = GetFields(node);
List<List<Fields>> records = new List<List<Fields>>();
using (StreamReader sr = new StreamReader(source))
{
//this is the string of data to process
string contents = sr.ReadLine();
while (sr.Peek() >= 0)
{...
multiline variable without having to write the string out to a file so I can
stream it in and use ReadLine(). Below is a snippet of code where I am trying
to read the string that has been passed into the function.
//source is the string of data to parse out
//nodes is the Xml Node Name in the mappingFile
("/Meters/Ion/Report/Field")
//ReadLine indicates whether to process line by line, or read as
continuous string
public List<List<Fields>> GetNodeData(string source, string node,
Boolean ReadLine)
{
//Get the field mappings.
List<Fields> record = GetFields(node);
List<List<Fields>> records = new List<List<Fields>>();
using (StreamReader sr = new StreamReader(source))
{
//this is the string of data to process
string contents = sr.ReadLine();
while (sr.Peek() >= 0)
{...