parent
8c5118effd
commit
06de3f0f74
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,20 @@
|
||||
import json
|
||||
|
||||
# 从外部文件读取 JSON 数据
|
||||
file_path = r'D:\dsWork\QingLong\音频文本.txt' # 替换为你的文件路径
|
||||
with open(file_path, 'r', encoding='utf-8') as file:
|
||||
json_data = file.read()
|
||||
|
||||
# 解析 JSON 数据
|
||||
data = json.loads(json_data)
|
||||
|
||||
# 提取 Text 属性并组装成文稿
|
||||
text_content = [item['Text'] for item in data]
|
||||
manuscript = ' '.join(text_content) # 将文本拼接成一个完整的文稿
|
||||
|
||||
# 输出或保存文稿
|
||||
print(manuscript) # 打印到控制台
|
||||
|
||||
# 如果需要保存到文件
|
||||
with open('文稿.txt', 'w', encoding='utf-8') as output_file:
|
||||
output_file.write(manuscript)
|
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue