cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

File Size Differences

sshaikh
New Contributor

image

Hi,
Why File Reader and File Writer size variation in the Pipeline?
I have make a simple pipeline to check my reader output file size and writer output file size and I have observed that reader and writer output size us not matching.
Could anyone please explain to me that.

12 REPLIES 12

Hi @sshaikh,

Good day, try to see if your original file json formt are properly indented or perhaps in pretty-print mode this might be the reason for the difference in file size

For better understanding, try to open both files then compare the contentโ€ฆ by comparing the files you will get your answer why thereโ€™s a difference in file size

Thanks,
EmEm

Hi @alchemiz
Good day,I have observed the input and output format of file. There was, for input proper structured json file file was there but for output json structure in a single line. I think the space utilization in proper format is reduced in output so its size reduced.
Input JSON file
Output JSON file
Thanks @alchemiz.
Is there any way in Snaplogic by which we can get the same structured for output just like input structure?

Why do you expect the size to be the same? Youโ€™re changing the format from XML to JSON. JSON is less verbose than XML, so if it contains the same data, I would expect it to be smaller.

@ptaylor
File Reader(Json File)>>Json Parser>>Json Formatter>>File Writter
If I read and write the file using above pipeline I am getting the reduced File Size at end.
Why there is Difference in file Size ?
Is there difference due to conversion from DOC to Binary and vice versa ?

Ok, so the use case youโ€™re asking about now changed to remove all XML and is only JSON?

I agree with @alchemiz. Iโ€™m guessing the bigger one is pretty-printed and the smaller one isnโ€™t. Try checking the pretty print option on the Formatter and see how it compares. Even then, there are many ways to pretty print JSON so it probably wonโ€™t match exactly, but it will be closer.