# Manipulate Barcode Scans

**URL:** <https://forum.universal-robots.com/t/manipulate-barcode-scans/14099>\
**Category:** URScript\
**Created:** [May 4, 2021, 5:32am UTC](https://forum.universal-robots.com/t/manipulate-barcode-scans/14099 "2021-05-04T05:32:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cbc.paulh](https://avatars.discourse-cdn.com/v4/letter/c/3da27b/32.png) [@cbc.paulh](https://forum.universal-robots.com/u/cbc.paulh)\
**Post date:** [May 4, 2021, 5:32am UTC](https://forum.universal-robots.com/t/manipulate-barcode-scans/14099/1 "2021-05-04T05:32:34Z")

</div>

I use a USB barcode scanner to scan a code to generate a series of number. Is there a way in URscript or command to trim certain part of the scan code. Like in Excel or other programming languages, there is LEFT, RIGHT, or MID etc…

---

<div class="post-metadata">

**Author:** ![anon12473600](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@anon12473600](https://forum.universal-robots.com/u/anon12473600)\
**Post date:** [August 1, 2021, 7:26pm UTC](https://forum.universal-robots.com/t/manipulate-barcode-scans/14099/2 "2021-08-01T19:26:27Z")

</div>

I am also looking for the solution.

---

<div class="post-metadata">

**Author:** ![anon12473600](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@anon12473600](https://forum.universal-robots.com/u/anon12473600)\
**Post date:** [August 1, 2021, 7:29pm UTC](https://forum.universal-robots.com/t/manipulate-barcode-scans/14099/3 "2021-08-01T19:29:12Z")

</div>

for this [barcode scanne](https://pageloot.com/barcode-scanner)r

---

<div class="post-metadata">

**Author:** ![ajp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ajp/32/471_2.png) [@ajp](https://forum.universal-robots.com/u/ajp)\
**Post date:** [August 2, 2021, 5:05am UTC](https://forum.universal-robots.com/t/manipulate-barcode-scans/14099/4 "2021-08-02T05:05:00Z")

</div>

Hi @anon12473600, @cbc.paulh, Yes you can convert number to string manipulate the string then convert back to number. Take a look at the script functions beginning with str\_ in the internals section of the script manual:

[https://www.universal-robots.com/download/?filters[]=98761&query=](https://www.universal-robots.com/download/?filters%5B%5D=98761&query=)
