ByteScout Data Extraction Suite - C# - Export results to xml, csv, txt with barcode reader sdk - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout Data Extraction Suite – C# – Export results to xml, csv, txt with barcode reader sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Data Extraction Suite – C# – Export results to xml, csv, txt with barcode reader sdk

How to export results to xml, csv, txt with barcode reader sdk in C# and ByteScout Data Extraction Suite

Continuous learning is a crucial part of computer science and this tutorial shows how to export results to xml, csv, txt with barcode reader sdk in C#

This sample source code below will display you how to export results to xml, csv, txt with barcode reader sdk in C#. ByteScout Data Extraction Suite: the set that includes 3 SDK products for data extraction from PDF, scans, images and from spreadsheets: PDF Extractor SDK, Data Extraction SDK, Barcode Reader SDK. It can export results to xml, csv, txt with barcode reader sdk in C#.

The SDK samples given below describe how to quickly make your application do export results to xml, csv, txt with barcode reader sdk in C# with the help of ByteScout Data Extraction Suite. This C# sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Check C# sample code samples to see if they respond to your needs and requirements for the project.

If you want to try other source code samples then the free trial version of ByteScout Data Extraction Suite is available for download from our website. Just try other source code samples for C#.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.cs
      
using System; using System.IO; using System.Text; using System.Xml; using Bytescout.BarCodeReader; namespace ExportResults { class Program { static void Main() { Reader reader = new Reader(); reader.RegistrationName = "demo"; reader.RegistrationKey = "demo"; // Set barcode type to find reader.BarcodeTypesToFind.All1D = true; /* ----------------------------------------------------------------------- NOTE: We can read barcodes from specific page to increase performance. For sample please refer to "Decoding barcodes from PDF by pages" program. ----------------------------------------------------------------------- */ // Read barcodes reader.ReadFromFile("barcodes.pdf"); // Export to files: // ================ // 1. Export found barcodes to XML reader.ExportFoundBarcodesToXML("barcodes.xml"); // 2a. Export found barcodes to CSV with default delimiter, quotation and character encoding reader.ExportFoundBarcodesToCSV("barcodes.csv"); // 2b. Export found barcodes to CSV with custom delimiter, quotation and character encoding reader.ExportFoundBarcodesToCSV("barcodes2.csv", "|", "'", Encoding.UTF8); // 3a. Export found barcodes to plain text file in default character encoding reader.ExportFoundBarcodesToTXT("barcodes.txt"); // 3b. Export only values of found barcodes to plain text file in custom character encoding reader.ExportFoundBarcodesToTXT("barcodes2.txt", true, Encoding.ASCII); // Get formatted result to a variable for further processing // ========================================================= // 1a. Get found barcodes as XmlDocument XmlDocument xmlDocument = reader.ExportFoundBarcodesToXMLDocument(); // 1b. Get found barcodes as XML string string xmlString = reader.ExportFoundBarcodesToXML(); // 2a. Get found barcodes as string in CSV format with default delimiter and quotation string csv = reader.ExportFoundBarcodesToCSV(); // 2b. Get found barcodes as string in CSV format with custom delimiter and quotation string csv2 = reader.ExportFoundBarcodesToCSV("|", "'"); // 3. Get found barcodes as string in plain text format string txt = reader.ExportFoundBarcodesToTXT(); // 4. Get found barcodes as string in JSON format string jsonString = reader.ExportFoundBarcodesToJSON(); // Cleanup reader.Dispose(); } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Data Extraction Suite Home Page

Explore ByteScout Data Extraction Suite Documentation

Explore Samples

Sign Up for ByteScout Data Extraction Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Data Extraction Suite Home Page

Explore ByteScout Data Extraction Suite Documentation

Explore Samples

Sign Up for ByteScout Data Extraction Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next