Skip to content

Issue reading strings #28

@carlm83

Description

@carlm83

I have a large file that I'm trying to read. Sample is attached. All of the numeric values appear to read fine, but some of the strings are corrupted.

Here is the code I used to read the data:

using (var output = new System.IO.StreamWriter(System.IO.File.Create(@"C:\Carl\tdms_example.txt")) )
using (var tdms = new NationalInstruments.Tdms.File(openFileDialog1.FileName) )
{
    tdms.Open();

    output.WriteLine("Properties:");

    foreach ( var property in tdms.Properties )
    {
        output.WriteLine("  {0}: {1}", property.Key, property.Value);
    }

    output.WriteLine();

    foreach ( var group in tdms )
    {
        output.WriteLine("    Group: {0}", group.Name);

        foreach ( var property in group.Properties )
        {
            output.WriteLine("    {0}: {1}", property.Key, property.Value);
        }

        output.WriteLine();

        foreach ( var channel in group )
        {
            output.WriteLine("        Channel: {0}", channel.Name);

            foreach ( var property in channel.Properties )
            {
                output.WriteLine("        {0}: {1}", property.Key, property.Value);
            }

            output.WriteLine();
        }
    }
}

Attached is the output data. See "Channel: 1850-5 Lower Element" for an example of the data corruption.

The Excel importer add-in reads the TDMS file fine so I don't believe it is corrupted.

tdms_example.txt

String Issue Sample.zip

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions