Spaces:
Sleeping
Sleeping
| import json | |
| def convert_json_to_text(json_path, text_path): | |
| # Read JSON data from file | |
| with open(json_path, 'r') as json_file: | |
| data = json.load(json_file) | |
| # Open a text file for writing | |
| with open(text_path, 'w') as text_file: | |
| for item in data: | |
| # Write only the extracted_content to the text file with a newline character | |
| text_file.write(f"{item['extracted_content']}\n") |