ByteScout Barcode Reader SDK - VB.NET - Batch Read Barcodes To CSV - 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 – Batch Read Barcodes To CSV

  • Home
  • /
  • Articles
  • /
  • ByteScout Barcode Reader SDK – VB.NET – Batch Read Barcodes To CSV

How to batch read barcodes to CSV in VB.NET using ByteScout BarCode Reader SDK

The tutorial below will demonstrate how to batch read barcodes to CSV in VB.NET

With this source code sample you may quickly learn how to batch read barcodes to CSV in VB.NET. Want to batch read barcodes to CSV in your VB.NET app? ByteScout BarCode Reader SDK is designed for it. ByteScout BarCode Reader SDK is the SDK for barcode decoding. Can read all popular types from Code 128, GS1, UPC and Code 39 to QR Code, Datamatrix, PDF417. Images, pdf, TIF images and live web camera are supported as input. Designed to handle documents with noise and defects. Includes optional splitter and merger for pdf and tiff based on barcodes. Batch mode is optimized for high performance with multiple threads. Decoded values can be exported to XML, JSON, CSV or into custom data format.

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 batch read barcodes to CSV. Just copy and paste the code into your VB.NET application’s code and follow the instruction. Test VB.NET sample code examples whether they respond your needs and requirements for the project.

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)

Program.vb
      
Imports Bytescout.BarCodeReader Module Program Sub Main() Try 'Read Barcode Process Dim reader As Reader = New Reader reader.RegistrationKey = "demo" reader.RegistrationName = "demo" ' Set Barcode type to find reader.BarcodeTypesToFind.SetAll() ' Output list Dim lstCSVOutput As New List(Of CSVOutputFormat) ' Get all files in folder, and iterate through each file Dim files = System.IO.Directory.GetFiles("BarcodeFiles") For Each fileName As String In files ' ----------------------------------------------------------------------- ' 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 Dim FoundBarcodes As FoundBarcode() = reader.ReadFrom(fileName) For Each code As FoundBarcode In FoundBarcodes lstCSVOutput.Add( New CSVOutputFormat With { .barcodeType = code.Type.ToString(), .barcodeValue = code.Value, .scanDateTime = DateTime.Now.ToString(), .fileName = fileName }) Next Next Console.WriteLine("Total {0} barcode found in {1} file.", lstCSVOutput.Count, files.Length) ' Export to CSV ExportToCsv(lstCSVOutput) ' Cleanup reader.Dispose() Catch ex As Exception Console.WriteLine(ex.Message) End Try Console.WriteLine("Press enter key to exit...") Console.ReadLine() End Sub Sub ExportToCsv(ByVal lstCSVOutput As List(Of CSVOutputFormat)) Dim csvOutputContent As New System.Text.StringBuilder(String.Empty) csvOutputContent.Append("Barcode Value,Barcode Type,Scan DateTime,File Name") For Each item As CSVOutputFormat In lstCSVOutput csvOutputContent.AppendFormat("{0}{1},{2},{3},{4}", Environment.NewLine, item.barcodeValue, item.barcodeType, item.scanDateTime, item.fileName ) Next System.IO.File.WriteAllText("output.csv", csvOutputContent.ToString()) Process.Start("output.csv") End Sub Class CSVOutputFormat Public Property barcodeValue As String Public Property barcodeType As String Public Property scanDateTime As String Public Property fileName As String End Class 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