Reading ugly csv with tons of commas csvhelper

huangapple go评论76阅读模式
英文:

Reading ugly csv with tons of commas csvhelper

问题

I see that you're trying to extract specific data from a complex CSV file with various formatting challenges. To help you, I'll provide guidance on how to extract the desired data.

For the lines starting with <Sub>, it appears that the data is delimited by multiple commas. You can split these lines by multiple commas to extract the values. Here's an example of how to do that:

// Assuming you have read a line into the variable 'line'
if (line.Contains("<Sub>"))
{
    var dataValues = line.Split(new string[] { ",," }, StringSplitOptions.None);

    // 'dataValues' will now contain an array of values, and you can access them by index.
    // For example, dataValues[0] will contain the first value, dataValues[1] the second, and so on.
}

For the lines with "Coordinate data (X, Y) (mm)", the data seems to be in a more traditional CSV format. You can continue using the CsvHelper library as you are currently doing to read these lines.

You can keep two separate lists for these two types of data if needed.

Remember to adjust your code accordingly to handle these different data formats within the same file. If you encounter specific issues or need further assistance with your code, please feel free to ask.

英文:

I have a csv file which looks like this:

,"CompanyNane",,,,,,,,,,,,,,,,,,,,,,,,,,,,Issue,,,,2021-02-27,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,Inspection Sheet  ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,<Sub>,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1/200,,,,page,,,,,
,Delivery No.,,,,,,,,SDK2302278101,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,W No.,,,,,,,,AFC1210-22SL,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,Manufacturer,,,,,,,,ManufacturerCompanyName,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,Diameter,,,,,,,,6in,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,Poly-type/Conductivity,,,,,,,,4H/n-type,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,face/Orientation,,,,,,,,Si/(0001) 4deg off,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,Surface Finish,,,,,,,,CMP,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,"Coordinate data (X, Y) (mm)",,,,,,,,,,,,,Thickness (um),,,,,,,,Carrier Conc. (cm-3),,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,(,,,", ",,,),,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,(,0,,", ",70.0,,),,,,,14.67,,,,,,,,6829484552804830,,,,,,,,,,,,,,,,,,14.67
,,,,,,,(,0,,", ",60.0,,),,,,,15.18,,,,,,,,7269218633966170,,,,,,,,,,,,,,,,,,15.18
,,,,,,,(,0,,", ",45.0,,),,,,,15.35,,,,,,,,7101511576788490,,,,,,,,,,,,,,,,,,15.35
,,,,,,,(,0,,", ",30.0,,),,,,,15.32,,,,,,,,6874133261805120,,,,,,,,,,,,,,,,,,15.32
,,,,,,,(,0,,", ",15.0,,),,,,,15.2,,,,,,,,6701359170793300,,,,,,,,,,,,,,,,,,15.2
,,,,,,,(,0,,", ",0.0,,),,,,,15.13,,,,,,,,6638519222094540,,,,,,,,,,,,,,,,,,15.13
,,,,,,,(,0,,", ",-15.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,0,,", ",-30.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,0,,", ",-45.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,0,,", ",-60.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,0,,", ",-67.0,,),,,,,15.04,,,,,,,,7104368264503040,,,,,,,,,,,,,,,,,,15.04
,,,,,,,(,,,", ",,,),,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,(,,,", ",,,),,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,(,-70,,", ",0.0,,),,,,,14.54,,,,,,,,6828523559220620,,,,,,,,,,,,,,,,,,14.54
,,,,,,,(,-60,,", ",0.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,-45,,", ",0.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,-30,,", ",0.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,-15,,", ",0.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,15,,", ",0.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,30,,", ",0.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,45,,", ",0.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,60,,", ",0.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,70,,", ",0.0,,),,,,,14.65,,,,,,,,6866040706547180,,,,,,,,,,,,,,,,,,14.65
,,,,,,,(,,,", ",,,),,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,Ave.,,,,,,,,,,,,,15.15,,,,,,,,6950000000000000,,,,,,,,,,,,,,,,,,
,,,,,Uniformity(sigma/Ave.),,,,,,,,,,,,,1.6,,,,,%,,,3.1,,,,,,%,,,,,,,,,,,,
,,,,,MAX,,,,,,,,,,,,,15.35,,,,,,,,7270000000000000,,,,,,,,,,,,,,,,,,
,,,,,MIN,,,,,,,,,,,,,14.54,,,,,,,,6640000000000000,,,,,,,,,,,,,,,,,,

I honestly don't even know where to begin, I have no control over this csv file, as it is an incoming file from elsewhere, surely there is a way to replace these commas somehow? I understand this data is very ugly, the top line, I need the issue with the date, then starting at the <sub> line, I need all data from that point forward.

The lines:

,&lt;Sub&gt;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1/200,,,,page,,,,,
,Delivery No.,,,,,,,,SDK2302278101,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,W No.,,,,,,,,AFC1210-22SL,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,Manufacturer,,,,,,,,ManufacturerCompanyName,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,Diameter,,,,,,,,6in,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,Poly-type/Conductivity,,,,,,,,4H/n-type,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,face/Orientation,,,,,,,,Si/(0001) 4deg off,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,Surface Finish,,,,,,,,CMP,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

Have their data horizontally, normally I can do this, just not with all those commas, it makes their indexes all different!

The lines:

,,,,,&quot;Coordinate data (X, Y) (mm)&quot;,,,,,,,,,,,,,Thickness (um),,,,,,,,Carrier Conc. (cm-3),,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,(,,,&quot;, &quot;,,,),,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,(,0,,&quot;, &quot;,70.0,,),,,,,14.67,,,,,,,,6829484552804830,,,,,,,,,,,,,,,,,,14.67
,,,,,,,(,0,,&quot;, &quot;,60.0,,),,,,,15.18,,,,,,,,7269218633966170,,,,,,,,,,,,,,,,,,15.18
,,,,,,,(,0,,&quot;, &quot;,45.0,,),,,,,15.35,,,,,,,,7101511576788490,,,,,,,,,,,,,,,,,,15.35
,,,,,,,(,0,,&quot;, &quot;,30.0,,),,,,,15.32,,,,,,,,6874133261805120,,,,,,,,,,,,,,,,,,15.32
,,,,,,,(,0,,&quot;, &quot;,15.0,,),,,,,15.2,,,,,,,,6701359170793300,,,,,,,,,,,,,,,,,,15.2
,,,,,,,(,0,,&quot;, &quot;,0.0,,),,,,,15.13,,,,,,,,6638519222094540,,,,,,,,,,,,,,,,,,15.13
,,,,,,,(,0,,&quot;, &quot;,-15.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,0,,&quot;, &quot;,-30.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,0,,&quot;, &quot;,-45.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,0,,&quot;, &quot;,-60.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,0,,&quot;, &quot;,-67.0,,),,,,,15.04,,,,,,,,7104368264503040,,,,,,,,,,,,,,,,,,15.04
,,,,,,,(,,,&quot;, &quot;,,,),,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,(,,,&quot;, &quot;,,,),,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,(,-70,,&quot;, &quot;,0.0,,),,,,,14.54,,,,,,,,6828523559220620,,,,,,,,,,,,,,,,,,14.54
,,,,,,,(,-60,,&quot;, &quot;,0.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,-45,,&quot;, &quot;,0.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,-30,,&quot;, &quot;,0.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,-15,,&quot;, &quot;,0.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,15,,&quot;, &quot;,0.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,30,,&quot;, &quot;,0.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,45,,&quot;, &quot;,0.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,60,,&quot;, &quot;,0.0,,),,,,,-,,,,,,,,-,,,,,,,,,,,,,,,,,,
,,,,,,,(,70,,&quot;, &quot;,0.0,,),,,,,14.65,,,,,,,,6866040706547180,,,,,,,,,,,,,,,,,,14.65
,,,,,,,(,,,&quot;, &quot;,,,),,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,Ave.,,,,,,,,,,,,,15.15,,,,,,,,6950000000000000,,,,,,,,,,,,,,,,,,
,,,,,Uniformity(sigma/Ave.),,,,,,,,,,,,,1.6,,,,,%,,,3.1,,,,,,%,,,,,,,,,,,,
,,,,,MAX,,,,,,,,,,,,,15.35,,,,,,,,7270000000000000,,,,,,,,,,,,,,,,,,
,,,,,MIN,,,,,,,,,,,,,14.54,,,,,,,,6640000000000000,,,,,,,,,,,,,,,,,,

These lines are like a traditional csv with a header at the top and the data underneath, but again, the commas make this real tricky. Any help would be appreciated! Just trying to get this data into a list.

Here's my current code:

class CsvHelperTester
    {
        static void Main(string[] args)
        {


            var csvConfig = new CsvConfiguration(CultureInfo.InvariantCulture)
            {
                HasHeaderRecord = false,
                HeaderValidated = null,
                IgnoreBlankLines = true,
                MissingFieldFound = null,
                AllowComments = true,
                Comment = &#39;;&#39;,
                Delimiter = &quot;,&quot;,
                TrimOptions = TrimOptions.Trim,
                
            };
            using (var streamReader = new StreamReader(&quot;C:filestuff&quot;))
            {
                using (var csv = new CsvReader(streamReader, csvConfig))
                {

                    var records = new List&lt;GeneralData&gt;();


                    while (csv.Read())
                    {
                        if (csv.GetField(1) == &quot;&quot;)
                        {
                            csv.Read();
                        }
                        records.Add(csv.GetRecord&lt;GeneralData&gt;());
                    }

                    var WRecords = csv.GetRecords&lt;WData&gt;().ToList();
                    var columns = records;

                }
            }
        }
        public class GeneralData
        {
            [Index(1)]
            public string Type { get; set; }
            [Index(2)]
            public string Value { get; set; }
        }
        public class WData
        {
            public string Coordinate_Data { get; set; }
        }

    }

I tried to make 2 lists, 1 for the horizontal data, and 1 for the traditional csv data, but was unsuccessful

答案1

得分: 2

要将所有重复的逗号替换为一个单独的逗号,请使用 Regex.Replace

将CSV文件作为字符串获取,然后使用:

string result = Regex.Replace(csvString, ",+", ",");

最后,将结果字符串转换回CSV。

英文:

To replace all the repeated commas with a single one use Regex.Replace

Get the CSV file as a string then use:

string result = Regex.Replace(csvString, &quot;,+&quot;, &quot;,&quot;);

Finally, convert the resulting string back to CSV

答案2

得分: 1

以下是代码的翻译部分:

void Main()
{
    var config = new CsvConfiguration(CultureInfo.InvariantCulture)
    {
        HasHeaderRecord = false
    };

    using (var reader = new StreamReader("C:filestuff"))
    using (var csv = new CsvReader(reader, config))
    {
        csv.Read();
        var company = csv.GetField(1);
        var issue = csv.GetField(29);
        var issueDate = csv.GetField(33);

        var topData = new List<TopData>();
        var coordinateData = new List<CoordinateData>();
        var summaryData = new List<SummaryData>();

        // Skip to <Sub>
        while (csv.Read() && csv.GetField(1) != "<Sub>") { }

        // Read Horizontal data
        while (csv.Read() && csv.GetField(5) != "Coordinate data (X, Y) (mm)")
        {
            if (csv.GetField(1) != string.Empty)
                topData.Add(csv.GetRecord<TopData>());
        }

        // Read Coordinate data
        while (csv.Read() && csv.GetField(5) != "Ave.")
        {
            if (csv.GetField(8) != string.Empty)
                coordinateData.Add(csv.GetRecord<CoordinateData>());
        }

        // Read Summary data
        summaryData.Add(csv.GetRecord<SummaryData>());
        while (csv.Read())
        {
            summaryData.Add(csv.GetRecord<SummaryData>());
        }
    }
}

public class TopData
{
    [Index(1)]
    public string Name { get; set; }
    [Index(9)]
    public string Value { get; set; }
}

public class SummaryData
{
    [Index(5)]
    public string Name { get; set; }
    [Index(18)]
    public string Value1 { get; set; }
    [Index(26)]
    public string Value2 { get; set; }
}

public class CoordinateData
{
    [Index(8)]
    public string X { get; set; }
    [Index(11)]
    public string Y { get; set; }
    [Index(18)]
    public string Mm { get; set; }
    [Index(26)]
    public string Thickness { get; set; }
}

希望对你有所帮助。如果有其他问题,请随时提出。

英文:

It is a bit ugly but I think you can use a combination of looking for known stopping points along with data classes that use indexing to find their columns.

void Main()
{
	var config = new CsvConfiguration(CultureInfo.InvariantCulture)
	{
		HasHeaderRecord = false
	};
	
	using (var reader = new StreamReader(&quot;C:filestuff&quot;))
	using (var csv = new CsvReader(reader, config))
	{
		csv.Read();
		var company = csv.GetField(1);
		var issue = csv.GetField(29);
		var issueDate = csv.GetField(33);
		
		var topData = new List&lt;TopData&gt;();
		var coordinateData = new List&lt;CoordinateData&gt;();
		var summaryData = new List&lt;SummaryData&gt;();
		
		// Skip to &lt;Sub&gt;
		while (csv.Read() &amp;&amp; csv.GetField(1) != &quot;&lt;Sub&gt;&quot;) { }
		
		// Read Horizontal data
		while (csv.Read() &amp;&amp; csv.GetField(5) != &quot;Coordinate data (X, Y) (mm)&quot;)
		{
			if (csv.GetField(1) != string.Empty)
				topData.Add(csv.GetRecord&lt;TopData&gt;());
		}

		// Read Coordinate data
		while (csv.Read() &amp;&amp; csv.GetField(5) != &quot;Ave.&quot;)
		{
			if (csv.GetField(8) != string.Empty)
				coordinateData.Add(csv.GetRecord&lt;CoordinateData&gt;());
		}
		
		// Read Summary data
		summaryData.Add(csv.GetRecord&lt;SummaryData&gt;());
		while (csv.Read())
		{
			summaryData.Add(csv.GetRecord&lt;SummaryData&gt;());
		}
	}
}

public class TopData
{
	[Index(1)]
	public string Name { get; set; }
	[Index(9)]
	public string Value { get; set; }
}

public class SummaryData
{
	[Index(5)]
	public string Name { get; set; }
	[Index(18)]
	public string Value1 { get; set; }
	[Index(26)]
	public string Value2 { get; set; }
}

public class CoordinateData
{
	[Index(8)]
	public string X { get; set; }
	[Index(11)]
	public string Y { get; set; }
	[Index(18)]
	public string Mm { get; set; }
	[Index(26)]
	public string Thickness { get; set; }
}

答案3

得分: 0

这是我的解决方案。您只有一个输入样本,所以我的代码可能需要一些调整才能在整个输入上正常工作。

英文:

Here is my solution. You only had one sample of the input so my code probably will need some tweaks before it will work on entire input.

<!-- begin snippet: js hide: false console: true babel: false -->

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;
namespace ConsoleApplication2
{
class Program
{
const string FILENAME = @&quot;c:\temp\test.csv&quot;;
public enum State
{
NONE,
GET_DELIVERY,
GET_PART
}
static void Main(string[] args)
{
StreamReader reader = new StreamReader(FILENAME);
string line = &quot;&quot;;
List&lt;Delivery&gt; deliveries = new List&lt;Delivery&gt;();
Delivery delivery = null;
Part part = null;
State state = State.NONE;
while((line = reader.ReadLine()) != null)
{
line = line.Trim(new char[] { &#39; &#39;, &#39;,&#39; });
if(line.Length &gt; 0)
{
if(line.StartsWith(&quot;&lt;Sub&gt;&quot;))
{
state = State.GET_DELIVERY;
delivery = new Delivery();
deliveries.Add(delivery);
continue;
}
if (line.StartsWith(&quot;\&quot;Coordinate data&quot;))
{
//do nothing
continue;
}    
switch (state)
{
case State.GET_DELIVERY:
if (line == &quot;(,,,\&quot;, \&quot;,,,)&quot;)
{
state = State.GET_PART;
part = new Part();
if (delivery.parts == null) delivery.parts = new List&lt;Part&gt;();
delivery.parts.Add(part);
continue;
}
delivery.AddProperty(line);
break;
case State.GET_PART:
if (line == &quot;(,,,\&quot;, \&quot;,,,)&quot;)
{
state = State.GET_DELIVERY;
continue;
}
part.AddPoint(line);
break;
}
}
}
}
}
public class Delivery
{
public string deliverNo { get; set; }
public string wNo { get; set; }
public string manufacturer { get; set; }
public string diameter { get; set; }
public string pTypeConductivity { get; set; }
public string faceOrientation { get; set; }
public string surfaceFinish { get; set; }
public decimal average { get; set; }
public decimal uniformitySigma { get; set; }
public decimal uniformityAve { get; set; }
public decimal max { get; set; }
public decimal min { get; set; }
public List&lt;Part&gt; parts { get; set; }
public void AddProperty(string line)
{
string[] splitArray = line.Split(new char[] {&#39;,&#39;});
switch(splitArray[0])
{
case &quot;Delivery No.&quot;:
deliverNo = splitArray[8];
break;
case &quot;W No.&quot;:
wNo = splitArray[8];
break;
case &quot;Manufacturer&quot;:
manufacturer = splitArray[8];
break;
case &quot;Diameter&quot;:
diameter = splitArray[8];
break;
case &quot;Poly-type/Conductivity&quot;:
pTypeConductivity = splitArray[8];
break;
case &quot;face/Orientation&quot;:
faceOrientation = splitArray[8];
break;
case &quot;Surface Finish&quot;:
surfaceFinish = splitArray[8];
break;
case &quot;Ave.&quot;:
average = decimal.Parse(splitArray[13]);
break;
case &quot;Uniformity(sigma/Ave.)&quot;:
uniformityAve = decimal.Parse(splitArray[13]);
uniformitySigma = decimal.Parse(splitArray[21]);
break;
case &quot;MAX&quot;:
max = decimal.Parse(splitArray[13]);
break;
case &quot;MIN&quot;:
min = decimal.Parse(splitArray[13]);
break;
}
}
}
public class Part
{
public string part { get; set; }
public decimal thinkness { get; set; }
public List&lt;Tuple&lt;decimal, decimal, decimal&gt;&gt; points { get; set; }
decimal lastThinkness = 0;
public void AddPoint(string line)
{
if (points == null) points = new List&lt;Tuple&lt;decimal, decimal, decimal&gt;&gt;();
string[] splitArray = line.Split(new char[] { &#39;,&#39; });
decimal x = decimal.Parse(splitArray[1]);
decimal y = decimal.Parse(splitArray[5]);
decimal thickness = (splitArray[12] == &quot;-&quot;) ? lastThinkness : decimal.Parse(splitArray[12]);
lastThinkness = thickness;
Tuple&lt;decimal, decimal, decimal&gt; point = Tuple.Create(x,y,thickness);
points.Add(point);
}
}
}

<!-- end snippet -->

huangapple
  • 本文由 发表于 2023年6月13日 04:15:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/76460038.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定