Hello,
So, I just bought the metadata module and I want to use it to string out certain parts of a JSON file that correspond with pdf files. When someone orders these tags a JSON file gets created with all the information for each tag along with the quantity that wanted to be ordered. This JSON file can get rather large 10,000+ lines. I was thinking that I need to send the JSON file through JSON pick up so that switch could read the data then I would use Pitstop variable to extract the information that I need by calling each line to create the slip sheet. I don't think that's going to work because I can't call a certain line because it's variable. Is there a way that I can use the file name to match it to a string and then grab that group of information? Or is there a better way to achieve this? Sorry if this doesn't make sense I just don't know what I need to do at the moment. I attached the dataset along with one of the pdf files, which I would create as a slip sheet. Let me know if more information is required.
Thank you
Using a Json Dataset to create a slip sheet for every input PDF
-
- Newbie
- Posts: 11
- Joined: Tue May 30, 2023 2:43 pm
Using a Json Dataset to create a slip sheet for every input PDF
- Attachments
-
- example.json.zip
- (12.88 KiB) Downloaded 359 times
-
- #13#_63043M.pdf.zip
- (44.88 KiB) Downloaded 346 times
Re: Using a Json Dataset to create a slip sheet for every input PDF
The JSON file is incomplete so you cannot do anything with it in an automated way (or did you remove a part because otherwise it would be too big?).
I could open the file as text of course. It contains URL links to the files. Do these also have to be downloaded as part of the process?
Conceptually, what you can do is to use "JSON pickup" to convert the JSON to an XML dataset. You can then export the XML dataset, split the XML into parts using the Saxonica app (requires a separate installation of Saxon) and process the individual XMLs.
The JSON-Pack app bundle has functionality to inject a job for each element of a JSON array.
I could open the file as text of course. It contains URL links to the files. Do these also have to be downloaded as part of the process?
Conceptually, what you can do is to use "JSON pickup" to convert the JSON to an XML dataset. You can then export the XML dataset, split the XML into parts using the Saxonica app (requires a separate installation of Saxon) and process the individual XMLs.
The JSON-Pack app bundle has functionality to inject a job for each element of a JSON array.
-
- Newbie
- Posts: 11
- Joined: Tue May 30, 2023 2:43 pm
Re: Using a Json Dataset to create a slip sheet for every input PDF
Hi Freddy,
That was the entire JSON file that I would get. I can change it to have whatever data I need theoretically (So, I'm going to work on removing all the unused information). Just out of curiosity what makes this JSON file incomplete so I can look for it in future projects?
I will look into the Saxonica app today! Thanks for the advice!
That was the entire JSON file that I would get. I can change it to have whatever data I need theoretically (So, I'm going to work on removing all the unused information). Just out of curiosity what makes this JSON file incomplete so I can look for it in future projects?
I will look into the Saxonica app today! Thanks for the advice!
Re: Using a Json Dataset to create a slip sheet for every input PDF
There is no need to remove anything. On the contrary.
Just open the JSON file in a text editor, scroll to the bottom and you will see it is incomplete: it ends with a comma. Editors that are JSON-aware (like VSC) will show there is an error, or you can copy&paste the file into an online JSON validator. If this is what you get from your customer, you need to talk to them.
Just open the JSON file in a text editor, scroll to the bottom and you will see it is incomplete: it ends with a comma. Editors that are JSON-aware (like VSC) will show there is an error, or you can copy&paste the file into an online JSON validator. If this is what you get from your customer, you need to talk to them.
-
- Newbie
- Posts: 11
- Joined: Tue May 30, 2023 2:43 pm
Re: Using a Json Dataset to create a slip sheet for every input PDF
I see it now! I have control to log out the information that I need in said JSON file so I think it would be easier to remove data I don't need and clean up the file a bit before switch.