-1

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 ?

Terry Burton
  • 2,801
  • 1
  • 29
  • 41
Ravi Rajindu
  • 380
  • 2
  • 6
  • 23
  • Are you looking for something like this? https://stackoverflow.com/a/46940181/4122889 – sommmen Aug 21 '20 at 09:30
  • 2
    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
  • 2
    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

1 Answers1

0

The data that you have provided has no valid interpretation:

  • As others have commented, in the GS1 system of Application Identifier data carried in a barcode symbol, the AIs are formatted first.
  • There are no AIs (56), (44) or (43) within the GS1 system.

The current list of all valid AIs, as defined in the GS1 General Specifications, is given here.

Terry Burton
  • 2,801
  • 1
  • 29
  • 41
  • 1) this question is 3.5 years old; doubtful it needs an answer for the OP, and 2) this is more of a comment than an answer (especially if you're just posting links to reference materials, or repeating what has been mentioned in comments already, which isn't needed at all) – David Makogon Mar 13 '23 at 13:59
  • @DavidMakogon What is the purpose of StackOverflow if not to create a useful repository of accurate information that points a number of future readers to solutions to their problem? I found this question through a search, and it is a languishing page. Otherwise will find it too, but now they will find pointers to useful resources. – Terry Burton Mar 13 '23 at 14:11
  • Except... the question is off-topic: no code, no debugging info, just a bit of output. It should be closed, based on how it's written. And the comments already direct the OP to some information. Your answer isn't an answer; it's telling them 1) that what they provided is "meaningless", and 2) where to find some information (with one of the links pointing to the same site as a link already provided in the comments). – David Makogon Mar 13 '23 at 14:17
  • I agree the question is low quality and should be closed. I've already flagged the question for moderation. "meaningless" indeed may be interpreted as harsh - I've revised the wording. After a period of time, rolling up comments (that are often hidden) into an answer that may or may not be improved upon is useful, regardless of whether it duplicates content. It separates good quality links from generic links that may have dubious quality. – Terry Burton Mar 13 '23 at 14:24