11-20-2015 07:06 AM
Hey 🙂
i have a Excel Sheet where i save some information for the Script.
in the past i had one information each field - so it was not problem to geht the information by
MyString = myProjekt.Cells(DataRow,1).Value
to bring more options in to my script, i decide to seperate the information in one field by unsing ";" an write it in a new line (same field)
the string i get in Diadem is
"Info1 ; Info2 ; info3"
but after each ; must be a CRLF oder CR oder a other functional character.
I will seperate my information by using
X = Split(MyString, ";", -1, vbTextCompare)
the command "trim" delete the space, but not the functional one
--> X(1) = "Info1"
--> X(2) = " Info2"
--> X(3) = " Info3"
In front of Info2 and 3 there is the functional character i did not get out of it.
Has someone a idea how to solve my problem?
thank you! have a nice weekend 😉
Solved! Go to Solution.
11-22-2015 03:45 PM - edited 11-22-2015 03:45 PM
Hi Malik,
The VBScript function you're looking for is Replace(), and you can pass it vbCRLF or vbCR or vbLF or just " ". You can also call the function multiple times if you have multiple ASCII chararacters you want to remove, such as:
MyStr = Replace(MyStr, vbCRLF, "")
MyStr = Replace(MyStr, " ", "")
Brad Turpin
DIAdem Product Support Engineer
National Instruments
11-23-2015 01:56 AM
Hey Brad_Turpin,
wow great - thank you
the Replace() command i still tried in my tests last week, but my fault was the command for CRLF -> vbCRLF
greets
maik