我需要从文件中提取数据,请参见下面的代码。
@rows =
EXTRACT booking_date string,
route string,
channel string,
pos string,
venta string,
flight_date string,
ancillary string,
paxs int?
FROM "/ventas/ventas1.csv"
USING Extractors.Text(delimiter:';', silent:true);
@output =
SELECT booking_date,
channel,
Convert.ToDouble(venta.Replace(",", ".")) AS venta,
paxs
FROM @rows;
我的问题是数字是西班牙语格式,意为“100234”,而不是“100.234”。有谁知道如何更改格式Extractors.Text,或者如何在整数U型SQL字符串转换?
导入列作为一个字符串,并更换句号,比如像这样:
@input =
EXTRACT venta string,
paxs int
FROM @inputFile
USING Extractors.Text(delimiter : ';');
@output =
SELECT Convert.ToInt32(venta.Replace(".", "")) AS venta
FROM @input;