当前位置:网站首页>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
边栏推荐
- [tf] Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initial
- ModuleNotFoundError: No module named ‘picamera‘
- arcpy. SpatialJoin_ Analysis spatial connection analysis
- PowerManagerService(一)— 初始化
- About vscode, "code unreachable" will be displayed when calling sendline series functions with pwntools“
- Ros2 - install ros2 (III)
- 1290_ Implementation analysis of prvtaskistasksuspended() interface in FreeRTOS
- [nvidia] CUDA_ VISIBLE_ DEVICES
- [software testing] 05 -- principles of software testing
- Import CV2 prompt importerror: libgl so. 1: Cannot open shared object file: no such file or directory
猜你喜欢
Logical structure and physical structure
PHY drive commissioning - phy controller drive (II)
SOC_ SD_ DATA_ FSM
ROS2——安装ROS2(三)
ROS2——topic话题(八)
C语言数组专题训练
Jenkins reported an error. Illegal character: '\ufeff'. Class, interface or enum are required
Mathematical analysis_ Notes_ Chapter 8: multiple integral
第 2 章:小试牛刀,实现一个简单的Bean容器
你心目中的数据分析 Top 1 选 Pandas 还是选 SQL?
随机推荐
Anaconda navigator click open no response, can not start error prompt attributeerror: 'STR' object has no attribute 'get‘
【Node】nvm 版本管理工具
Spinningup drawing curve
About vscode, "code unreachable" will be displayed when calling sendline series functions with pwntools“
ROS2——配置开发环境(五)
Raspberry pie 4B arm platform aarch64 PIP installation pytorch
SOC_ SD_ DATA_ FSM
Ethtool principle introduction and troubleshooting ideas for network card packet loss (with ethtool source code download)
Ros2 - first acquaintance with ros2 (I)
ROS2——node节点(七)
Xiaomi written test real question 1
[software testing] 04 -- software testing and software development
ModuleNotFoundError: No module named ‘picamera‘
PHY drive commissioning --- mdio/mdc interface Clause 22 and 45 (I)
ROS2——安装ROS2(三)
[node] differences among NPM, yarn and pnpm
The problem of configuring opencv in qt5.13.2 is solved in detail
Logical structure and physical structure
Altimeter data knowledge point 2
What is soda?