splitting a serial number to 2 lines based on a certain character 追蹤

0
Avatar
REN DUTOIT

Hi,

I would like to know if there is an easy VB script that could split my GRN | Serial number from one line of text to two if a certain character is present?

For example, we have parts that have a GRN value and some parts have GRN and a Serial number.

Our Excel database sheet always has both combined but with a "|" character separator. So I want to have two separate lines of values on the Label, one for GRN and one for Serial Number with the script splitting it up when the "|" character is present.

 

Any help would be appreciated.

Thank you.

7 意見

0
Avatar
Pete Thane
評論操作 永久連結

No need to use VB, just use the Transforms> Seach and Replace option

0
Avatar
REN DUTOIT
評論操作 永久連結

Thank you Pete for the quick response.

This does work for me but I was hoping to do this with VB script to keep all our actions in one place rather than relying the the system functions. It also makes backing our files up safer to keep functions and actions.

If you can let me know that would be great,

Thank you.

0
Avatar
REN DUTOIT
評論操作 永久連結

Also, on an unrelated question.

Would there be a way to integrate Bartender to DEAR systems? (https://dearsystems.com/)

The whole export function seems so tedious every time to update our printing database.

Thank you.

Ren

0
Avatar
Pete Thane
評論操作 永久連結

Sorry I dont know anything about that and what database they use etc.

Have you looked at Integration Builder to see if there is anyway to utilise that? Such as at print time the user clicks on a button/function in your DEAR system and then that creates an output file with all the data in it that the integration picks up and automatically prints? 

0
Avatar
Adam Flores Sr
評論操作 永久連結

In regards to using a vbScript option,

Select the "Transform" Tab and select "vb Script"

and type the follwing:

Value = Replace(Value,"|",vbCrLf)

That it's all you need. you can always change the value of the character to replace as needed

I hope this will be useful

Regards

Adam Flores Sr.

 

 

 

0
Avatar
Adam Flores Sr
評論操作 永久連結

in regards to you other question

Would there be a way to integrate Bartender to DEAR systems? (https://dearsystems.com/)

it it's better you submit the question in a separate post

so it can be followed by itself otherwise it will always show as:

splitting a serial number to 2 lines based on a certain character

and you would never see a response to your second questions.

and if possible describe the process your using now.

Regards

Adam Flores Sr.

 

 

0
Avatar
REN DUTOIT
評論操作 永久連結

Thank you very much Adam and Pete for your input.

Pete, your script worked just fine (with some minor alterations)

Now would there be a way to change font style with code to only some text with VB script within that same VB statement?

I did some searching but unsuccessful.

I will also, submit a new ticket on the DEAR question.

Thank you very much,

Ren

登入寫評論。