manonz.SpssCommon 1.0.0

dotnet add package manonz.SpssCommon --version 1.0.0
                    
NuGet\Install-Package manonz.SpssCommon -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="manonz.SpssCommon" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="manonz.SpssCommon" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="manonz.SpssCommon" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add manonz.SpssCommon --version 1.0.0
                    
#r "nuget: manonz.SpssCommon, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=manonz.SpssCommon&version=1.0.0
                    
Install manonz.SpssCommon as a Cake Addin
#tool nuget:?package=manonz.SpssCommon&version=1.0.0
                    
Install manonz.SpssCommon as a Cake Tool

C# SPSS SAV file reader and writer library

This library enables to write SPSS data files (.sav). The library is UTF-8 safe.

It is available as a nuget package at https://www.nuget.org/packages/manonz.SpssWriter, and can be installed using the package manager or by issuing:

Install-Package manonz.SpssCommon
Install-Package manonz.SpssWriter

It's a fork of https://github.com/Anderman/Medella.SPSS adding the ability to handle multiple-response variables.

To write a data file:

// Create Variable list
    var variables = new List<Variable>
    {
        new Variable<string>("var0", 8)
        {
            Label = "label for var0",
            ValueLabels = new Dictionary<string, string>
            {
                ["a"] = "valueLabel for a",
                ["b"] = "valueLabel for b"
            }
        }.UserMissingValues(MissingValueType.OneDiscreteMissingValue, new[] { "-" }),
        new Variable<double>("var2", 7, 3)
        {
            Label = "label for var2",
            ValueLabels = new Dictionary<double, string>
            {
                [15.5] = "valueLabel for 15.5",
                [16] = "valueLabel for 16"
            }
        }.UserMissingValues(new[] { 0d }),
        new Variable<DateTime>("var4", 20)
        {
            Label = "label for var4",
            ValueLabels = new Dictionary<DateTime, string>
            {
                [new DateTime(2020, 1, 2)] = "valueLabel for 2 jan 2020",
                [new DateTime(2020, 1, 1)] = "valueLabel for 1 jan 2020"
            }
        }
    };
    // create data
    var data = new List<object?>
    {
        "string", 15.5, new DateTime(2020, 1, 1),
        null, null, null
    };

    //Write variable and data to a stream
    var ms = new MemoryStream();
    SpssWriter.Write(variables, data, ms);

If you find any bugs or have issues, please open an issue on GitHub.

SAV file format

Binary description of *.sav file format is available here: http://www.gnu.org/software/pspp/pspp-dev/html_node/System-File-Format.html.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on manonz.SpssCommon:

Package Downloads
manonz.SpssWriter

A cleancode library for writing spss .sav files. Medella.SPSS with multiple response additions. See https://github.com/Anderman/Medella.SPSS

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 178 3/12/2025