The following code generates a dataset from a table within a webpage:
ClearAll; resultsByTurbineTypeRaw = Import["https://www.vestas.com/en/products/track_record#!results-by-turbine-type", "Data"]; position = FirstPosition[resultsByTurbineTypeRaw, "Wind Turbine"] resultsByTurbineTypeRaw[[2, 6, 1, 1]] resultsByTurbineType1 = resultsByTurbineTypeRaw[[2, 6, Range[20]]]; first = First[resultsByTurbineType1] rest1 = Rest[resultsByTurbineType1]; listB = Join[{first}, rest1]; vestasOrdersByTurbineType = Dataset[AssociationThread[First@listB, #] & /@ Rest@listB] It can be noted upon code execution that the values for the columns "Quantity" and "Total MW" can contain commas but do not always do so.
How can I create the proper syntax for a StringReplace function that deletes the commas so that the substituted values are presented as Numbers rather than Strings, thereby creating a new version of the dataset without commas, while not failing on Strings that do not contain commas?