Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/28/12 11:48:05 (10 years ago)
Author:
abeham
Message:

#1922: Used the culture's defined list separator in CSV export

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Clustering/CSV/ClusteringCSVInstanceProvider.cs

    r8211 r8530  
    2222using System;
    2323using System.Collections.Generic;
     24using System.Globalization;
    2425using System.IO;
    2526using System.Text;
     
    8586
    8687      foreach (var variable in instance.InputVariables) {
    87         strBuilder.Append(variable + ";");
     88        strBuilder.Append(variable + CultureInfo.CurrentCulture.TextInfo.ListSeparator);
    8889      }
    89       strBuilder.Remove(strBuilder.Length - 1, 1);
     90      strBuilder.Remove(strBuilder.Length - CultureInfo.CurrentCulture.TextInfo.ListSeparator.Length, CultureInfo.CurrentCulture.TextInfo.ListSeparator.Length);
    9091      strBuilder.AppendLine();
    9192
     
    9495      for (int i = 0; i < dataset.Rows; i++) {
    9596        for (int j = 0; j < dataset.Columns; j++) {
    96           strBuilder.Append(dataset.GetValue(i, j) + ";");
     97          if (j > 0) strBuilder.Append(CultureInfo.CurrentCulture.TextInfo.ListSeparator);
     98          strBuilder.Append(dataset.GetValue(i, j));
    9799        }
    98         strBuilder.Remove(strBuilder.Length - 1, 1);
    99100        strBuilder.AppendLine();
    100101      }
Note: See TracChangeset for help on using the changeset viewer.