Add a word to a serial number.
-
Hello,
I have a hand held bar code scanner connected to a laptop and am reading the barcodes on boxes. When I read the barcode notepad++ puts the serial on a line then the next serial below it.
What I would like to happen is for NPPP to put a word for example SALES- then the serial from the barcode. So as I receive the inventory I end up with a list like this:SALES-340958347
SALES-459450300
SALES- 229393495NPPP will put the department name then the serial as they are read off the barcodes on the boxes.
After all the boxes are checked in and I have a list of the new SALES-459450300 serial I need to print one new serial to a small 1" x !.5" sticker so I can put them on the product when they get used.
Right now I check in all the boxes so I have a list of serials then I have to manually add the name of the department like SALES-, ACC-, MARK-,TECH-, then I have to put 5 enters between each number so when I go to print to the zebra printer it prints one serial to each label.
If someone could help me figure out how to have the word appear in front of the serial number each time they are read from the box and then print one new serial to a barcode label I would really appreciate it.
Thank you for your help.
-
@BBQ-Phantom said in Add a word to a serial number.:
If someone could help me figure out how to have the word appear in front of the serial number each time they are read from the box and then print one new serial to a barcode label
It seems to me like your (very simplified) workflow looks something like the following:
- You have some process that generates a text file
- You read the text file in Notepad++
- You print it out
and (correct me if I’m wrong) your problem seems to be in step (1), because you want to change the way that the data are generated, so that the data you care about is entered into the text file.
Assuming I’m correct, there is nothing this forum can do to help you. We would be more than happy to help you with step (2), but any step that does not involve Notepad++ is off-topic for this forum.
-
@BBQ-Phantom As I mentioned earlier the barcode reader puts the serial number into NPPP. The only reason why I mentioned it is to give context to how the data gets into NPPP nothing this forum has to worry about. NPPP works great with a barcode reader.
What I am asking about is specifically about notepad++ and how I can accomplish this task with it.
How do I set NPPP to put a word like HR- at the beginning of each line so when the barcode reader puts the serial # on each line it comes after the HR-Serial#?The second item is if I have one line in NPPP like HR-serial sure it prints out fine it puts one line on one sticker. If I put more than one line in NPPP without a bunch of enters in between lines it prints as many lines as it can fit on one sticker, Which is about 5.
Is there a setting in NPPP that will only print one line on each sticker and be in the middle of the sticker?
-
You’ve just actually repeated your initial question without adding anything more so we could point you in any different direction to what has already been explained.
A barcode reader is in reality just a specialized keyboard. When you scan, it enters those characters just as if you typed them. So it is a serial interface. To have text appear in amongst the input you need to look to the source, to a type of barcode reader that can do that. I’m not a specialist with these so have no idea if such a thing even exists.
However you may just be looking at it the wrong way. As a possible solution, all you need to do is complete the batch of scans, then have a macro (just recorded keystrokes) insert at the start of every line, the text you wish to have appear. You could also have that macro generate a number of blank lines (if you knew how many) between every line.
Terry
EDIT: I should also add that the output (to printer) is generally also a function of the print driver and other “external” applications. Notepad++ has very little control. But check out Settings, Preferences, Print, then the margins. Online manual for this is here. maybe you can increase top and bottom margins until effectively only 1 line will print on each “page” (sticker).
-
@Terry-R Thank you for you reply is there a way in NPPP to automatically populate a word at the begging of each line so I can then input data after it?
-
Short answer no. Longer answer is that by using one of the programming languages supported within Notepad++ such as Python, or possibly even NPPExec it might be possible. However what would be required is that it, rather than Notepad++ would need to receive the input from the barcode, add the text and then send it on. All very complicated, and you’d need to do a lot of learning to even attempt this method. It’s probably unlikely someone will go to a lot of trouble to create a program for you, and get you to understand exactly the process you’d need to follow to enable it and smoothly execute it.
I am wondering if you just don’t understand my alternative, or haven’t even considered another way. All that you really need to do is have each line correct before printing. Whether the additional text is added as the barcode is read, or added after Notepad++ has added the barcode to the line is irrelevant. The 2 steps can happen in either order, result is still the same. That is unless you really aren’t explaining yourself fully.
Terry
-
@Terry-R Ok, I don’t know why this concept is difficult to make a hybrid name when checking in products that is it. If the implementation is not possible in NPPP that’s what I wanted to know.
When I tried implementing the macros you suggested it would not record all of the steps that I needed. After I had a list of serials I turned on the recorder then recorded each step. To the left of the serial i typed HR- then right arrow to the end of the serial and then enter 5 times and save the macro or whatever the instructions said. For whatever reason it wouldn’t work as a macro on the list.
I know it can be done with excel I was just hoping to use something more user friendly.
-
@BBQ-Phantom said in Add a word to a serial number.:
When I tried implementing the macros you suggested it would not record all of the steps that I needed
Well you can if you use what we call Regex (regular expression). In the Replace function you will see there are 3 search modes, regex is the 3rd one. The idea is the find field would look something like:
Find What:^(\d+)
and the Replace field would look like:
Replace With:\r\n\r\n\r\n\r\n\r\nHR-${1}
Setting search mode to Regular expression, having the cursor in the very first position of the file, then click “Replace All”. This puts 5 empty lines first, then adds HR- to the number. It repeats for all lines in the tab in NPP. Try it. It’s not going to be totally accurate as it might need altering to suit your exact circumstances.
Terry
PS this can eventually be recorded as a macro. Copy the red text above directly into each field.
-
All that barcode readers do is to emulate keystrokes. And that is how NPP sees the input: Just keystrokes. NPP has no notion of whether the input is coming from a barcode reader or a regular keyboard. So I think Terry’s suggestion is your best bet.