加载csv文件的时间列为string类型且长度不等如何转为正确的time类型?

样例数据如下,请问如何对8点、9点的原始数据的左边进行补0,希望转成08:45:06.000,10:30:02.000

t = table(`84506000`93001000`103002000 as time, 1..3 as price)


attachments-2022-10-bwXcZYnf634cba6107612.png


请先 登录 后评论

1 个回答

Yating Xie

lpad函数在str的左边填充指定字符串

t.replaceColumn!(`time, temporalParse(lpad(string(t.time),9,`0), "HHmmssSSS"))

attachments-2022-10-zABODmUU634ce8c248132.png
请先 登录 后评论
  • 1 关注
  • 0 收藏,733 浏览
  • BMO 提出于 2022-10-17 10:14

相似问题