public void CreateDatadictionaryFromSpsssav(string filepath, string sourcefilename) { using (FileStream fileStream = new FileStream(filepath + sourcefilename, FileMode.Open, FileAccess.Read, FileShare.Read, 2048 * 10, FileOptions.SequentialScan)) { // Create the reader, this will read the file header SpssReader spssDataset = new SpssReader(fileStream); // Iterate through all the varaibles foreach (var variable in spssDataset.Variables) { // Display name and label Debug.WriteLine("{0} - {1}", variable.Name, variable.Label); // Display value-labels collection foreach (KeyValuePair <double, string> label in variable.ValueLabels) { Debug.WriteLine(" {0} - {1}", label.Key, label.Value); } uwac.Variable newvar = new uwac.Variable(variable); if (newvar != null) { this.vars.Add(newvar); } } } ExtractValuesets(); }
public void CreateDatadictionaryFromREDCapMeta(DataTable dt_meta, List <string> formnames) { foreach (DataRow row in dt_meta.Rows) { if (formnames.Contains(row["form_name"])) { uwac.Variable var = new uwac.Variable(row); string raw_vallabels = row["select_choices_or_calculations"].ToString(); if (raw_vallabels.Contains("|")) { uwac.Valueset valset = new Valueset(raw_vallabels); if (valset != null) { var.valueset = valset; } } if (var != null) { vars.Add(var); } } } ExtractValuesets(); }