Click here to Skip to main content
15,607,554 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi. I want to merge all of .json files to a .json file in a folder. after merging I want to search for a specific key in it, or submit a query to find a value for asked key in .json file.

What I have tried:

I tested alot of codes in github and etc.
Posted
Updated 3-Jan-23 21:58pm
Comments
Richard MacCutchan 4-Jan-23 3:42am    
And? Do you have an actual question?

1 solution

JSON isn't a database: That's not a database, dude![^]
To "merge" JSON files, they all need to be using the same data structure (not guaranteed) and require you to either load the JSON data into python classes and merge those before generating a new JSON string from the result, or write your own JSON parser to read the content of each file and process it into data you can understand yourself.

There is no "search json files" code because JSON files aren't a database!
 
Share this answer
 
Comments
CPallini 4-Jan-23 4:08am    
5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900