NetSuite formula text extract characters from string - formula

For NetSuite, I have a text field shown below:
"Three Phase Power Requirement:
Voltage(VAC): 208,
Max Power(VA): 24638,
Max Current/Phase(A): 68,
Circuit Breaker(A): 80"
I am trying to write a formula which extracts the values below, such as "208", "24638", etc..
What type of formula would need to be used to extract these characters into a Formula(text)? Any examples are appreciated. Thank you!

try this:
ADD FORMULA(TEXT) field and add this in formula: REGEXP_SUBSTR({purchasedescription}, '[Voltage(VAC): ](\d+)',2,1,'c',1)
Another FORMULA(TEXT)
REGEXP_SUBSTR({purchasedescription}, '[Max Power(VA): ](\d+)',2,2,'c',1)

Related

How concat multiple fields for a GS1 Data-matrix (BXN) in Zebra Programming Lang (ZPL)

I'm trying to show some data in a GS1 Datamatrix which has field separators (FNC1,GS) pass within the variable to a zpl template.
Originally, in ZebraDesigner I couldn't get zpl to allow me to pass the separators within the parameter/variable. The separators would only show as text within the data, not as control characters for the scanner. (I was able to pass the separators as Fix Data, however it needs to work with a parameter).
Alternatively, I was hoping to edit the zpl and concatenate the control characters and QR values into one printed data for the Datamatrix.
This is zpl using one variable QRCode: (This works but not with passed separators)
^BY208,208^FT448,1123^BXN,8,200,0,0,1,~
^FH\^FN18^FDQRCode^FS
This is using fixed data where FNC1 is \7E and GS is \1D: (This works but doesn't use variables/parameters)
^BY208,208^FT448,1123^BXN,8,200,0,0,1,~
^FH\^FD\7E188text234567890\1Dmoretext^FS
This is my attempt to concat the separators and variables QRData1...:
^BY208,208^FT448,1123^BXN,8,200,0,0,1,~
^FH\^FD\7E^FN18^FDQRData1^FN22^FD\1D^FDQRData2^FD\1D^FN23^FDQRData3^FS
Unfortunately, the QR code only shows the value for the last var QRData3
Escape your field seperator hex codes with an _ (underscore), not with a backslash.
And use only one ^FD command like in your second example.
For reference see the pages of the commands ^FD, ^FH and ^BX in the Zebra ZPL II Programming Giude
As the OP found out, the field seperator _d029 worked for him! This is the hex value (0xD029) for the control character.
More information can be found here:
Encode GS,RS, and EOT for Code 128 and PDF417
GS is ~029
RS is ~030
EOT is ~004
Example:
[)><RS>06<GS>13V12GG7<GS>1P029-102489-157<GS>NC-411-661478-1<RS><EOT>
Enter the data as:
[)>~03006~d02913V12GG7~0291P029-102489-157~029NC-411-661478-1~030~004
Encode GS,RS, and EOT for Data Matrix, Aztec, and QR Code
GS is ~d029
RS is ~d030
EOT is ~d004
Example:
[)><RS>06<GS>13V12GG7<GS>1P029-102489-157<GS>NC-411-661478-1<RS><EOT>
Enter the data as:
[)>~d03006~d02913V12GG7~d0291P029-102489-157~d029NC-411-661478-1~d030~d004

extract string using same pattern in a text using R

I'm trying to deal with text with R and here is my question.
From this source text
#Pray4Manchester# I hope that #ArianaGrande# will be better soon.
I want to extract Pray4Manchester and ArianaGrande using the pattern #.+#, but when I run
str_extract_all(text,pattern="#.+#")
I get
#Pray4Manchester# I hope that #ArianaGrande#
How to solve this? Thanks.
We can do
str_extract_all(text, "(?<=#)\\w*(?=#)")[[1]]
#[1] "Pray4Manchester" "ArianaGrande"
data
text <- "#Pray4Manchester# I hope that #ArianaGrande# will be better soon."
You could use regex to look for results that match text between two hashes that don't contain a space character.
Something like this: ([#]{1}[^\s]+[#]{1})

Find and Replace a character in a string in VB.NET

I have a certain input string in this form: "[3] [4] at [5]"
From the following datatable, I need to replace the text on the datatable corresponding to the column index inside the bracket.
The output should be: "15A Circuit Breaker #348901836 at 19-Afalcon St. Capitol Subdivision"
Right now, I am using Regex.Replace() method but it searches for a particular pattern. My problem is the integers (corresponding the column index) enclosed inside the brackets is dynamic.
What would be the best way to achieve this?
String.Format should do it for you. Both the format string and the arguments can be easily implemented dynamically.
https://msdn.microsoft.com/en-us/library/system.string.format.aspx
All of the syntax, and a decent example of what you wish to do are on the linked page.

Regex to Change Particular Text to CAPS

I have a string like this
<PolygonHotSpot PostBackValue="M001" AlternateText="small letters" Coordinates="93, 57, 94" />
I need rejex to capture only AlternateText value and change it into CAPS like SMALL LETTERS
So the string would be
<PolygonHotSpot PostBackValue="M001" AlternateText="SMALL LETTERS" Coordinates="93, 57, 94" />
I've treied something but none of them worked.
People here are not fans of using regex to parse html. With all the warnings about doing so, here's the general method for regex. Someone else may give you the Dom parser alternative (in which case use it).
Use this regex: AlternateText="([^"]*). It captures the text you want to Group 1.
In the replacement, use a lambda to replace Group 1 with what you need.
I could help you with C#, but don't know the ASP.NET syntax. Someone else can give you the details. :)
Explanation
[^"] is a negative character class that matches any character that is not a double quote
the * quantifier matches zero or more of those
the (parentheses) capture that match to Group 1

Regular Expression format for 0000/123456/23

I have a text box for Registration Number and i want it to use the following format 2013/123456/25. I want to validate for in-correct format using Regular Expression Validator.
The exact format must be first 4 numbers/6 numbers/2 numbers -->(2013/123456/25)
Thank you for your help...
You could use something like this :
^\d{4}/\d{6}/\d{2}$

Resources