0

I have a barcode (GS1). I need to get the scanned result into a text box for further processes. But the scanned result does not contains the delimeters as expected.

Expected Barcode Result - 313233(56)42(44)556(43)

As an example I use (56) and (44) as start and end delimiters to get values in between.

Actual Scanned Result - 31323356424455643

Is there a way to read values from a barcode with delimeters ?

Ravi Rajindu
  • 376
  • 2
  • 6
  • 21
  • Are you looking for something like this? https://stackoverflow.com/a/46940181/4122889 – sommmen Aug 21 '20 at 09:30
  • 1
    Yes; set up the scanner to send them, and set up the receiving code to receive them. That's as much as you can get without specifying what scanner you use, which features it supports, how it's connected and what you use to read data from it. – GSerg Aug 21 '20 at 09:31
  • Are you posting a string or bytes? Why do you think you should have delimiters? It looks like you have a byte array and need to extract the bytes in code. – jdweng Aug 21 '20 at 10:20
  • Use code like this : { string input = "31323356424455643"; byte[] bytes = input.Select((x,i) => new {x = x, i = i}).GroupBy(x => x.i/2).Select(x => Byte.Parse(x.First().x.ToString() + x.Last().x.ToString(), NumberStyles.HexNumber)).ToArray(); string output = Encoding.UTF8.GetString(bytes); – jdweng Aug 21 '20 at 10:25
  • 1
    If it is a GS1, it will start with brackets first. Isn't your example compliant with GS1? [GS1 DataBar -Wikipedia](https://en.wikipedia.org/wiki/GS1_DataBar), [GS1-128 - Wikipedia](https://en.wikipedia.org/wiki/GS1-128), [GS1 Application Identifiers](https://www.gs1.org/standards/barcodes/application-identifiers) If so, isn't the GS1 mechanism applicable? – kunif Aug 21 '20 at 10:58

0 Answers0