当前位置:网站首页>Batch convert txt to excel format
Batch convert txt to excel format
2022-07-05 07:15:00 【RS&Hydrology】
What you want to achieve : The batch will txt Convert to corresponding Excel Format ( One txt The file corresponds to a Excel file ).
1. Use existing tools ( It is suitable for the situation of small amount of data )
It can be converted online directly :https://anyconv.com/txt-to-xlsx-converter/
Pro testing can be used , But download one by one .
2. utilize VBA
Sub txt2excel()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Dim txt, fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
.AllowMultiSelect = True
If .Show = -1 Then
For Each txt In .SelectedItems
Workbooks.OpenText Filename:=txt, Origin:=936, DataType:=xlDelimited, Semicolon:=False, Comma:=True, Space:=False, Other:=False, Tab:=True
Range("a:u").NumberFormatLocal = "@"
ActiveWorkbook.SaveAs Filename:=Mid(txt, 1, Len(txt) - 4) & ".xls", FileFormat:=xlExcel8
'ActiveWorkbook.SaveAs Filename:=Mid(txt, 1, Len(txt) - 4), FileFormat:=xlExcel8
ActiveWorkbook.Close True
Next
Else
Exit Sub
End If
End With
End Sub
边栏推荐
- Raspberry pie 4B arm platform aarch64 PIP installation pytorch
- Oracle code use
- Database SQL practice 3. Find the current salary details of the current leaders of each department and their corresponding department number Dept_ no
- [vscode] search using regular expressions
- Install deeptools in CONDA mode
- D2L installation
- Use of Pai platform
- testing framework
- Intelligent target detection 59 -- detailed explanation of pytoch focal loss and its implementation in yolov4
- 第 2 章:小试牛刀,实现一个简单的Bean容器
猜你喜欢
Import CV2 prompt importerror: libgl so. 1: Cannot open shared object file: no such file or directory
并发编程 — 死锁排查及处理
SOC_SD_DATA_FSM
Literacy Ethernet MII interface types Daquan MII, RMII, smii, gmii, rgmii, sgmii, XGMII, XAUI, rxaui
[software testing] 03 -- overview of software testing
SOC_ SD_ CMD_ FSM
Delayqueue usage and scenarios of delay queue
ROS2——工作空间(五)
Docker installs MySQL and uses Navicat to connect
DataGrid offline installation of database driver
随机推荐
ROS2——topic话题(八)
Energy conservation and creating energy gap
What if the DataGrid cannot see the table after connecting to the database
[vscode] search using regular expressions
U-Boot初始化及工作流程分析
苏打粉是什么?
Use of Pai platform
现在有html文件,和用vs制作的mvc(连接了数据库),怎么两个相连?
Ros2 topic (VIII)
【obs】x264编码:“buffer_size“
SOC_ SD_ CMD_ FSM
Powermanagerservice (I) - initialization
SOC_SD_CMD_FSM
NPM and package common commands
The difference between new and malloc
【Node】nvm 版本管理工具
第 2 章:小试牛刀,实现一个简单的Bean容器
[vscode] recommended plug-ins
Target detection series - detailed explanation of the principle of fast r-cnn
2022.06.27_ One question per day