gpt4 book ai didi

excel - 删除 excel、csv 或文本文件中的空白

转载 作者:行者123 更新时间:2023-12-03 03:39:58 25 4
gpt4 key购买 nike

我有一个 Excel 文件,其中包含运行者到达 9 次中间检查的时间。因此,每个参与者的总次数为 9,但实际时间之间的许多条目都是空白。如何删除每一列中的空格?

enter image description here

我尝试转换为 txt 并执行以下操作,但没有成功,因为列时间之间不再有任何分隔:

tr -d ' ' < input.txt > no-spaces.txt
tr -d '[:blank:]' < input.txt > no-spaces.txt
tr -d '[:space:]' < input.txt > no-spaces.txt

https://askubuntu.com/questions/537956/sed-to-delete-blank-spaces

我想要的是如下内容:

enter image description here

最佳答案

使用 VBA,您可以:

Sub deleteBlanks()
Columns("A:Z").SpecialCells(xlCellTypeBlanks).Delete Shift:=xlUp
End Sub

之前:

enter image description here

之后:

enter image description here

或者您可以使用自动筛选器,这样您就可以隐藏每列中的空白行...然后您可以选择区域,然后复制并粘贴为值。

关于excel - 删除 excel、csv 或文本文件中的空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42030053/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com