当前位置:网站首页>【R语言】对文件进行归一化整理到各文件类型文件夹
【R语言】对文件进行归一化整理到各文件类型文件夹
2022-08-09 05:57:00 【仿生bug】
把混乱的文件类型归类
# 把混乱的文件类型归类
getwd() # 当前路径
# 查看所有文件
(allfiles=list.files(recursive = TRUE))
split(allfiles,fdrop = T)
# 取文件的后缀
a=t(data.frame(strsplit(allfiles,split = "\\.")))
rownames(a)=NULL
b=unique(a[,2])
# 创建对应后缀的文件夹
for (i in b) {
dir.create(i)
}
# 拷贝移动
(a=as.data.frame(a))
a[,3] <- allfiles
a2=a[order(a[,2]),];a2
a3=as.vector(a2[,3]);a3
b2=sort(a[,2]);b2
# 归类整理
for (i in seq_along(a3)) {
file.copy(from = a3[i],to = b2[i])
}
边栏推荐
- Build a "firewall" for safety and carry out firefighting training in Fengzhuang Township, Tongxu County, Henan Province
- [GO]、数组与切片
- 【Word】Add subscripts to the text of Word at the same time
- 5年测试开发工程师感悟——写给还在迷茫中的朋友
- 多行字符串排序在线工具
- MATLAB图像处理入门
- 2022-08-08:给定一个数组arr,表示从早到晚,依次会出现的导弹的高度。 大炮打导弹的时候,如果一旦大炮定了某个高度去打,那么这个大炮每次打的高度都必须下降一点。 1) 如果只有一个大炮,返回
- Webgis地图框架的对比
- Fe3O4/SiO2 Composite Magnetic Nanoparticles Aminated on SiO2-NH2/Fe3O4 Surface (Qiyue Reagent)
- shell函数、数组
猜你喜欢
随机推荐
shell regular expressions
qt发送邮件程序
sqlserver导入数据类型问题
数组 冒泡排序
Superparamagnetic iron [email protected]@cadmium sulfide nanocore-shell structure material|Fe3O4 magnetic nanop
A day to learn a public company: Sophia
2022-08-08 顾宇佳 学习笔记
AIOT介绍
Cysteine/Galactose/Perylenediimide Functionalized Fe3O4 Fe3O4 Nanomaterials | Scientific Research Reagents
[GO]、数组与切片
域名批量查询在线工具
mysql查看表的创建时间
Initials-Letter Query Tool-Word Abbreviation Query Online Tool
记一个 nest.js 路由匹配后面所有路径问题
Molybdenum disulfide/hafnium dioxide composite nanomaterials (MoS2/HfO2) | tantalum-doped hafnium dioxide nanoparticles (Qi Yue bio)
数据中台项目前期总结
feof它可不简单。
shell函数、数组
盒子模型中垂直分布的基本内容
5G对物流行业的积极影响








