3 dolphinDB关于金融数据导入的问题

题目描述

导入金融数据时,在csv文件中,时间类型数据由于为string 或者int
如何处理成datetime类型

attachments-2021-05-wqAyxl6060952a113e60e.png
例如这个9点30分0秒0毫秒

指定了读取文件的时间格式,还是无法正确读取
temp_schemaTB[`format] =[,"HHmmssSSS","HHmmssSSS",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]
t1 = ploadText(tempPath,,temp_schemaTB)


请先 登录 后评论

1 个回答

Qing Li

参考loadTextEx函数可以转换读取到数据的数据类型

def d2m(mutable t){
    return t.replaceColumn!(`point_code,symbol(t.point_code))
}
tmpTB=loadTextEx(dbHandle=database("dfs://table_join"),tableName=`dkh_point_summary_daily,partitionColumns=`point_code,filename="/home/jwu/data/hailan/dkh_point_summary_daily.csv",delimiter="",transform=d2m);
请先 登录 后评论