ByteScout Barcode Reader SDK - VB.NET - Export Results to XML, CSV, TXT - 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 Barcode Reader SDK – VB.NET – Export Results to XML, CSV, TXT

  • Home
  • /
  • Articles
  • /
  • ByteScout Barcode Reader SDK – VB.NET – Export Results to XML, CSV, TXT

How to export results to xml, csv, TXT in VB.NET with ByteScout BarCode Reader SDK

How to code in VB.NET to export results to xml, csv, TXT with this step-by-step tutorial

With this source code sample you may quickly learn how to export results to xml, csv, TXT in VB.NET. Want to export results to xml, csv, TXT in your VB.NET app? ByteScout BarCode Reader SDK is designed for it. ByteScout BarCode Reader SDK is the barcode decoder with support for code 39, code 128, QR Code, Datamatrix, GS1, PDF417 and all other popular barcodes. Can read barcodes from images, pdf, tiff documents and live web camera. Supports noisy and damaged documents, can split and merge pdf and tiff documents based on barcodes. Can export barcode decoder results to XML, JSON, CSV and into custom data structures.

This rich sample source code in VB.NET for ByteScout BarCode Reader SDK includes the number of functions and options you should do calling the API to export results to xml, csv, TXT. In your VB.NET project or application you may simply copy & paste the code and then run your app! Code testing will allow the function to be tested and work properly with your data.

Our website provides trial version of ByteScout BarCode Reader SDK for free. It also includes documentation and source code samples.

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

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

Module1.vb
      
Imports System.IO Imports Bytescout.BarCodeReader Imports System.Text Imports System.Xml Module Module1 Sub Main() Dim reader As 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 Dim xmlDocument As XmlDocument = reader.ExportFoundBarcodesToXMLDocument() ' 1b. Get found barcodes as XML string Dim xmlString = reader.ExportFoundBarcodesToXML() ' 2a. Get found barcodes as string in CSV format with default delimiter and quotation Dim csv As String = reader.ExportFoundBarcodesToCSV() ' 2b. Get found barcodes as string in CSV format with custom delimiter and quotation Dim csv2 As String = reader.ExportFoundBarcodesToCSV("|", "'") ' 3. Get found barcodes as string in plain text format Dim txt As String = reader.ExportFoundBarcodesToTXT() ' 4. Get found barcodes as string in JSON format Dim jsonString = reader.ExportFoundBarcodesToJSON() 'Cleanup reader.Dispose() End Sub End Module

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout BarCode Reader SDK Home Page

Explore ByteScout BarCode Reader SDK Documentation

Explore Samples

Sign Up for ByteScout BarCode Reader SDK 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 BarCode Reader SDK Home Page

Explore ByteScout BarCode Reader SDK Documentation

Explore Samples

Sign Up for ByteScout BarCode Reader SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next