|
发表于 2022-1-19 08:09
来自手机
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
drop table if exists aa;create temp table aa as select *,regexp2('日期:(\d{4}年\d+月\d+日)',txt内容,1) 日期,regexp2('数[:]\s*(\d+人)',txt内容,1) 人数,regexp2('^\d、.*',txt内容) 内容,iif(txt内容 like 'FengeFu',rowid,'') 组 from 正则拆分txt施工内容;create temp table bb as select *,fillna(组) 组2 from aa;create temp table cc as select trim(group_concat(distinct(日期)),',') `日期:`,trim(group_concat(distinct(人数)),',') `施工人数:`,replace(trim(group_concat(distinct(内容)),','),',',"") `工作内容:` from bb group by 组2;select rowid as 序,* from cc; |
|