We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
同问
Sorry, something went wrong.
import json def process_json_lines(input_file, output_file): fixed_data = [] with open(input_file, 'r', encoding='utf-8') as infile: for line in infile: try: # 解析每一行JSON数据 json_data = json.loads(line.strip()) # 这里可以根据需要对json_data进行处理 fixed_data.append(json_data) except json.JSONDecodeError as e: print(f"Error decoding JSON: {e} in line: {line}") # 将所有解析和处理后的数据写入输出文件,格式化为JSON数组 with open(output_file, 'w', encoding='utf-8') as outfile: json.dump(fixed_data, outfile, ensure_ascii=False, indent=4) input_file = 'gptwords.json' output_file = 'gptwords.out.json' process_json_lines(input_file, output_file)
JSON: gptwords.out.json SQL: words.txt
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: