I'm new in crystal report.I want to split string from field data ,Ex. data is "aa : dasdas^bb : dasdas^cc : dasdasd^dd : dsadasd^"
And this is my code in crystal report with basic syntax.
Dim xvs1() as string
Dim xresult as string
if isnull({Field_Data}) = false then
xvs1 = Split({Medical.mr_vs} , "^")
xresult = xvs1(1)
formula = xresult
end if
Output in crystal report : "aa : dasdas^bb : dasdas^cc : dasdasd^dd : dsadasd^" ,Process is not split, and error not found in my solution, Please help Thank you so much.
Related
i have thoses lines of code :
$idprat = Praticien::select('ID_Praticien')->where('NOM',$request->input('ID_Praticien'))->get();
$mission->ID_Praticien = $idprat;
and i have this error message :
la valeur nvarchar '[{"ID_Praticien":1}]' en type de données int
why it's return me nvarchar on a int column on my database ?
i tried to make it correct like this :
$idprat = Praticien::select('ID_Praticien')->where('NOM',$request->input('ID_Praticien'))->get()->first();
and i tried with :
$mission->ID_Praticien = (int)$idprat;
but doesnt work
i just selected ID_Praticien value not an array xD
thanks for help ;)
Try this:
$idprat = Praticien::select('ID_Praticien')->where('NOM',$request->input('ID_Praticien'))->get();
$mission->ID_Praticien = $idprat[0]->ID_Praticien;
or
$idprat = Praticien::select('ID_Praticien')->where('NOM',$request->input('ID_Praticien'))->first();
$mission->ID_Praticien = $idprat->ID_Praticien;
I have this type of data :
--Line1 : val1=10; val2=20; val3=30
--Line2 : val1=11; val2=21; val3=31
--Line3 : val1=12; val2=22; val3=32
--Line4 : val1=13; val2=23; val3=33
--Line5 : val1=14; val2=24; val3=34
--Line6 : val1=15; val2=25; val3=35
--Line7 : val1=16; val2=26; val3=30
Now, i am trying to write a script to get any particular value (say val1 for Line4) on the basis of string "Line1", Line2, etc.
Any hint? Working in linux.
I am reading a log file and matching a pattern in the file; and if it matches do the regex on the line.
f = File.open(file,"r")
f.seek(0,IO::SEEK_END)
while true do
select([f])
line = f.gets
if line =~ pattern
a = line.sub(/ .*$/, "")
I have tried the above method and it fails for some reason.
So I have
"2017053007:00:02 : INFO : Processing bucket : East3"
coming into the line after matching the pattern. Just need to get this "2017053007:00:02" filtered out using the regex.
Thanks
input = "2017053007:00:02 : INFO : Processing bucket : East3"
input[/(?<=\A\d{10}:\d{2}:\d{2}\s:\s).*/]
#⇒ "INFO : Processing bucket : East3"
input[/\S+/]
#⇒ "2017053007:00:02"
Maybe you could try :
([0-9]+:[0-9]{2}:[0-9]{2})
without REGEX:
> a = "2017053007:00:02 : INFO : Processing bucket : East3"
> a.split.first
#=> "2017053007:00:02"
I have no knowledge of VBScript and need help.
Logically - I thought of splitting it with # in a for loop and then using : to split again.
Example:
Text file:
a : 21312 # asdfasd23sad : 43624 # asdsad*:21
Excel file:
Function arr()
input = a : 21312 # asdfasd23sad : 43624 # asdsad*:21
arr1 = Split(input, "#")
For i = Lbound(arr1) To Ubound (arr1)
arr2 = Split(arr1(i),":")
For j = Lbound(arr2) To Ubound (arr2)
Msgbox arr2(j)
Next
Next
End function
I'm working on some automation project.
The Data is passed in LabVIEW form a third party hardware, and is further passed to WinCC Flexible via a OPC server in float datatype.
The output display field supports string output. The data is displayed on the display field is processed in the VBScript.
The problem being faced is :
WinCC support float tags and has a maximum length of 4.
The output to be displayed on Display Field is of type string.
When the data is passed through LabVIEW following happens:
Example 1:
LabVIEW Data : 1.27e-4 | Output on WinCC Flex : 0.000127 [Wrong Representation]
All the data below e-5 are represented like above.
Example 2:
LabVIEW Data : 1.27e-10 | Output on WinCC Flex : 1.27E-10 [Correct Rep.]
Is there any way in VBScript to format the output data into exponential notation?
Currently am using this VBS for the representation...
If SmartTags("tag_06_1") = 0 Then SmartTags("output_1") = CStr (SmartTags("presseure_test"))
The best (most bang for the buck (bug?)) solution to all formatting problems in VBScript is to harness .NET formatting. Simple POC script:
Dim aNums : aNums = Split("0.123 1.27e-4 1.27e-10")
Dim sNum
For Each sNum in aNums
WScript.Echo sNum, CDbl(sNum), fmtExpNum(CDbl(sNum))
Next
Function fmtExpNum(dblX)
Dim oSB : Set oSB = CreateObject("System.Text.StringBuilder")
oSB.AppendFormat "{0:E2}", dblX
fmtExpNum = oSB.ToString()
End Function
output (german locale):
0.123 0,123 1,23E-001
1.27e-4 0,000127 1,27E-004
1.27e-10 0,000000000127 1,27E-010