小编pyt*_*arn的帖子

如何从python中的文件中删除空格以外的特殊字符?

我有一个庞大的文本语料库(逐行),我想删除特殊字符,但维持字符串的空间和结构.

hello? there A-Z-R_T(,**), world, welcome to python.
this **should? the next line#followed- by@ an#other %million^ %%like $this.
Run Code Online (Sandbox Code Playgroud)

应该

hello there A Z R T world welcome to python
this should be the next line followed by another million like this
Run Code Online (Sandbox Code Playgroud)

python regex string file string-formatting

9
推荐指数
3
解决办法
4万
查看次数

标签 统计

file ×1

python ×1

regex ×1

string ×1

string-formatting ×1