gpt4 book ai didi

java - 使用 java 提取 movie.json.1 (扩展名 (.1) )

转载 作者:太空宇宙 更新时间:2023-11-04 11:37:10 26 4
gpt4 key购买 nike

    File file = new File("D:\\final\\movie.json.1");
String resp = readFile(file);

JSONArray array = new JSONArray(resp);

但它给出了以下异常(exception):

    Exception in thread "main" org.json.JSONException: Missing value at 1 [character 2 line 1]

电影.json.1:示例文本:

[{"id":"episode_45747","resourceId":"45747","docType":"episode","uniqueName":"45747","locale":["eng"],"filter_locale":["eng"],"filter_device":

如果将文本从 .json.1 文件复制到 .txt 文件,则此方法有效。

请帮我提取此类扩展文件。

最佳答案

你能尝试使用 JSON 解析器吗?

JSONParser parser = new JSONParser();
JSONArray array = (JSONArray) parser.parse(new FileReader("D:\\final\\movie.json.1"));

关于java - 使用 java 提取 movie.json.1 (扩展名 (.1) ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43153235/

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