ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I believe it is- it outputs one "line" of data successfully in the CVS format but does not continue any further. It does not parse into the next part of the line.
Code:
$ ./out2.pl < 19_1.txt
Scan barcode and press enter
Got carriage return
Parsing the following input:
CHECKPOINT in 'if' at ./out2.pl line 16, <STDIN> line 1.
$CENTAUR30298309 000130287018
000130318905 000130295355
000130295344 000130295333
000130209138 000130210705
000130217293 000130273352
000130292823 000130292834
000130293065 000130293076
000130293087 000130293000
000130293010 000130293021
000130292415 000130292426
000130292947 000130292958
0001$
Wrote a line to data.txt: 30298309, , ,0001
I believe it is- it outputs one "line" of data successfully in the CVS format but does not continue any further. It does not parse into the next part of the line.
Code:
$ ./out2.pl < 19_1.txt
Scan barcode and press enter
Got carriage return
Parsing the following input:
CHECKPOINT in 'if' at ./out2.pl line 16, <STDIN> line 1.
$CENTAUR30298309 000130287018
000130318905 000130295355
000130295344 000130295333
000130209138 000130210705
000130217293 000130273352
000130292823 000130292834
000130293065 000130293076
000130293087 000130293000
000130293010 000130293021
000130292415 000130292426
000130292947 000130292958
0001$
Wrote a line to data.txt: 30298309, , ,0001
So, why not to increase number on members like this:
Code:
(.{8})(.{20})(.{8})(.{4})
in the 'if' statement and correspondingly why not to print the newly added $N variables into the output file ?
By the way, the thread name doesn't appear to be relevant. I.e. I think you are dealing with a particular file format parsing issue, not specifically with PDF417.
By the way, the thread name doesn't appear to be relevant. I.e. I think you are dealing with a particular file format parsing issue, not specifically with PDF417.
Well it is a PDF417 barcode which needs to be parsed, that is the data you could get from a barcode with corresponds to the PDF417 standard.
No there is nothing else other than the positions in the data. There is nothing else to split the individual fields apart other than the length
So the header is
$CENTAUR = 8 characters
First item of data starts at 9th Character
First record ends at 8+8+20+8+4 = 48th character
Second field would look like this with regard to character numbers:
# 49 50 51 52 53 54 55 56
# 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
# 77 78 79 80 81 82 83 84
# 85 86 87 88
So split at the 56, 76 ,84 and 88
#Input spec PDF417 label
#Header: $CENTAUR
#Record format:
#<code_length_8><batch_length_20><expiry_length_8><quantity_length_4>
#Footer: $
#Fields contain white space if empty
#Max 22 records
#No spaces between fields if values present
#Example complete barcode input
...
No there is nothing else other than the positions in the data.
...
Then why do you ask ? I.e. the only (lame) optimization available is not to write manually '.', '{', '(', ')', '}'. Yes, this can be trivially done, i.e. the regular expression can be taken from a variable, and the variable contents can be generated in a loop - each position number will be enclosed into '.', '{', '(, ')', '}'.
But you will have to manually fill array of position numbers.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.