Please help with the following situation:
Using ZPL script, I have to generate a barcode with GS1-128 (formally known as Code 128). I have the following specs:
The ideal way to label products is with complex barcodes with delimiters (cf. the GS1 standard, on the GS1-128 barcode model).
The following information is contained in the same barcode:
2. SSCC (only for pallet label);
3. EAN code;
4. Quantity;
5. Expiration date;
6. Lot.
LABEL STRUCTURE EAN 128
(00) - 18 numeric characters
Example: 712300000000125672 - SSCC - Unique pallet code;
(01) / (02) - 14 numeric characters
Example: 02911225000004 - EAN article (includes control key);
(3100) - 6 numeric characters, weight in kilograms without decimals
Example: (3100)000700 represents 700 KG.
(3101) - 6 numeric characters, weight in kilograms with a decimal
Example: (3101)000700 represents 70.0 KG.
(3102) - 6 numeric characters, weight in kilograms to two decimal places
Example: (3102)000700 represents 7.00 KG.
(3103) – 6 numeric characters, weight in kilograms to three decimal
Example: (3103)000700 represents 0.700 KG.
(37) - numeric characters, variable length up to 8 characters - number of packages / pallet.
(17) - 6 numeric characters
Example: 210730 - Expiry date in AALLZZ format
(10) - alphanumeric characters, variable length up to 20 characters
Example: 3245AB / 60 - Lot.CODE.
In order for the system to read the information in the barcode correctly, it can be created in two ways:
The first way is by placing all fields with variable length at the end of the barcode ((37) and (10)) without the need to insert a GS128 separator in the label.
EXAMPLE:
PALLET CODE (SSCC) must always be created separately on the pallet label.
SSCC code:
How it looks scanned:
A second way to create these labels is by inserting the GS128 separator after completing the variable length fields ((37) (10)) when they are inside the barcode.
PALLET CODE (SSCC) must always be created separately on the pallet label.
Example of pallet label with GS128 separator.
It looks scanned like this:
Last part of code:
Looks scanned like:
Thank you very much.
Related
There is a number like this:
77.18%
It should be displayed like this:
77.2%
I have formatting using:
.4s , .3s, .1% and few other formats which didn't make any change to the format.
Right now the adaptive formatting in Apache superset is giving 2 digits after the decimal, what should be the number format in order to display percentage number with 1 digit after the decimal?
With d3.js, d3.format(".1%")(0.7718) will return 77.2%.
You have to give a decimal number in input to the formatter.
I have a VB file were can a HEX value ‘0D25’ come in any position from 1 to 20 (values from 21 position should not be changed). This need to be replaced with HEX value ‘4040’.
Input:
----+----1----+----2----+----3----+----4----+
0000/12345678 566 #(#)#0000/12345678 566
FFFF6FFFFFFFF02FFF44B475BFFFF6FFFFFFFF02FFF02
0000112345678D5566005DBD50000112345678D5566D5
Expected output:
----+----1----+----2----+----3----+----4----+
0000/12345678 566 #(#)#0000/12345678 566
FFFF6FFFFFFFF44FFF44B475BFFFF6FFFFFFFF02FFF02
000011234567800566005DBD50000112345678D5566D5
I was using SORT with below control card.
SORT FIELDS=COPY
OUTREC FIELDS=(1,4,5,20,CHANGE=(20,X'0D25',X'4040'),
NOMATCH=(5,20),
21)
CHANGE= does not work the way you think it does. It does a lookup at only the specified position. It then replaces with either the replacement character(s), or with the NOMATCH= character(s) in exactly the length specified as the first sub-parm of CHANGE= (20 in your case).
FINDREP= searches for the specified character(s) in each position, and replaces with the replacement character(s). You limit to the part of the record to be inspected with the STARTPOS=, and ENDPOS= keywords, resp.
In your case the following statement should do what you want:
OUTREC FINDREP=(INOUT=(X'0D25',X'4040'),STARTPOS=5,ENDPOS=24)
I came across this line in the book 'The Go Programming Languague' on page 112.
fmt.Printf("#%-5d %9.9s %.55s\n", item.Number, item.User.Login, item.Title)
What do %9.9s and %.55s mean?
From go doc fmt:
Width is specified by an optional decimal number immediately preceding the verb. If absent, the width is whatever is necessary to represent the value. ....
For strings, byte slices and byte arrays, however, precision limits the length of the input to be formatted (not the size of the output), truncating if necessary.
Thus, %.9.9s means minimal width 9 runes with input truncated at 9, and thus exactly length 9. Similar %.55s means no minimal width but input truncated at 55 which means output is at most 55 runes.
An action outputs a fixed-length string via Ruby's pack function
clean = [edc_unico, sequenza_sede, cliente_id.to_s, nome, indirizzo, cap, comune, provincia, persona, note, telefono, email]
string = clean.pack('A15A5A6A40A35A5A30A2A40A40A18A25')
However, the data is in UTF-8 as to allow latin/high-ascii characters. The result of the pack action is logical. high-ascii characters take the space of 2 regular ascii characters. The resulting string is shortened by 1 space character, defeating the original purpose.
What would be a concise ruby command to interpret high-ascii characters and thus add an extra space at the end of each variable for each high-ascii character, so that the length can be brought to its proper target? (note: I am assuming there is no directive that addresses this specifically, and the whole lot of pack directives is mind-muddling)
update an example where the second line shifts positions based on accented characters
CNFrigo 539 Via Privata Da Via Iseo 6C 20098San Giuliano Milanese MI02 98282410 02 98287686 12886480156 12886480156 Bo3 Euro Giuseppe Frigo Transport 349 2803433 M.Gianoli#Delanchy.Fr S.Galliard#Delanchy.Fr
CNIn's M 497 Via Istituto S.Maria della Pietà, 30173Venezia Ve041 8690111 340 6311408 0041 5136113 00115180283 02896940273 B60Fm Euro Per Documentazioni Tecniche Inviare Materiale A : Silvia_Scarpa#Insmercato.It Amministrazione : Michela_Bianco#Insmercato.It Silvia Scarpa Per Liberatorie 041/5136171 Sig.Ra Bianco Per Pagamento Fatture 041/5136111 (Solo Il Giovedi Pomeriggio Dalle 14 All Beniservizi.Insmercato#Pec.Gruppopam.It
It looks like you are trying to use pack to format strings to fixed width columns for display. That’s not what it’s for, it is generally used for packing data into fixed byte structures for things like network protocols.
You probably want to use a format string instead, which is better suited for manipulating data for display.
Have a look at String#% (i.e. the % method on string). Like pack it uses another little language which is defined in Kernel#sprintf.
Taking a simplified example, with the two arrays:
plain = ["Iseo", "Next field"]
accent = ["Pietà", "Next field"]
then using pack like this:
puts plain.pack("A10A10")
puts accent.pack("A10A10")
will produce a result that looks like this, where “Next field” isn’t aligned since pack is dealing with the width in bytes, not the displayed width:
Iseo Next field
Pietà Next field
Using a format string, like this:
puts "%-10s%-10s" % plain
puts "%-10s%-10s" % accent
produces the desired result, since it is dealing with the displayable width:
Iseo Next field
Pietà Next field
I have a string called indicators, that the original developer of this application used to store single characters to indicate certain components of a model. I need to change the 7th character in the string, which I tried to do with the following code:
indicators[6] = "R"
The problem, I discovered quickly, was that the string is not always 7 characters long. For example, I have one set of values with U 2, that I need to convert to U 2 R (adding an additional space after the 2). Is there an easy way to force character count with Ruby?
use String.ljust(integer, padstr=' ')
If integer is greater than the length of [the receiver], returns a new String of
length integer with [the return value] left justified and padded with padstr;
otherwise, returns [an unmodified version of the receiver].
indicators = indicators.ljust(7)
indicators[6] = "R"