- Timestamp:
- 08/28/12 11:48:05 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/CSV/RegressionCSVInstanceProvider.cs
r8211 r8530 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Globalization; 24 25 using System.IO; 25 26 using System.Linq; … … 85 86 } 86 87 public override void ExportData(IRegressionProblemData instance, string path) { 87 StringBuilder strBuilder = new StringBuilder();88 var strBuilder = new StringBuilder(); 88 89 89 90 foreach (var variable in instance.InputVariables) { 90 strBuilder.Append(variable + ";");91 strBuilder.Append(variable + CultureInfo.CurrentCulture.TextInfo.ListSeparator); 91 92 } 92 strBuilder.Remove(strBuilder.Length - 1, 1);93 strBuilder.Remove(strBuilder.Length - CultureInfo.CurrentCulture.TextInfo.ListSeparator.Length, CultureInfo.CurrentCulture.TextInfo.ListSeparator.Length); 93 94 strBuilder.AppendLine(); 94 95 95 Datasetdataset = instance.Dataset;96 var dataset = instance.Dataset; 96 97 97 98 for (int i = 0; i < dataset.Rows; i++) { 98 99 for (int j = 0; j < dataset.Columns; j++) { 99 strBuilder.Append(dataset.GetValue(i, j) + ";"); 100 if (j > 0) strBuilder.Append(CultureInfo.CurrentCulture.TextInfo.ListSeparator); 101 strBuilder.Append(dataset.GetValue(i, j)); 100 102 } 101 strBuilder.Remove(strBuilder.Length - 1, 1);102 103 strBuilder.AppendLine(); 103 104 } 104 105 105 using ( StreamWriter writer = new StreamWriter(path)) {106 using (var writer = new StreamWriter(path)) { 106 107 writer.Write(strBuilder); 107 108 }
Note: See TracChangeset
for help on using the changeset viewer.