Function removes commas that are between quotes. This is useful when an imported text file's record string values are separated by commas.
This option does not remove commas in a comma separated string (see AsString function). When numbers are not created within Trading Blox Builder, use the ReplaceString function to remove commas.
Often output from other systems and/or applications will put quotes around numbers with commas, in comma delimited files, so the number stays together in the same field. When that happens this function is what is needed to correct that problem. In use this happens when importing data from a file where the numbers might been copied from a report and were formatted with comma so make reading their value easier. Not removing the comma from a comma separated list of values will cause the number with the comma to be view as two different values, instead of a single larger value.
For example, a comma separated string value read in from a file could have fields that are encased in quotes, and within that they may have additional commas. In order to use the GetField function on this string, it is necessary to remove the commas from between the quotes so the field count returned from GetFieldCount is correct. This function will also remove the quotes, since they are not required anymore.
The GetField function will read each value as a string, and convert numbers to numbers if necessary.
See also the RemoveNonDigits function to remove $ signs and other non digits from number strings.
Syntax: |
---|
RemoveCommasBetweenQuotes( inputString ) |
Parameter: |
Description: |
---|---|
inputString |
String from which commas are to be removed. |
This is example uses a simple method to emulates the contents of what a file record might contain within some of its numeric fields.
Example: |
---|
VARIABLES: stringRecord Type: String
|
Results: |
Orginal string from file: 10,20,30,"40,000",50,60 Field 4 is: "40 Field 5 is: 000"
New converted string: 10,20,30,40000,50,60 Field 4 is: 40000 Field 5 is: 50 |
Links: |
---|
Chr, GetField, GetFieldCount, RemoveNonDigits, ReplaceString |
See Also: |
Edit Time: 9/18/2020 1:50:14 PM |
Topic ID#: 496 |