Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • this works great! It identifies the empty files and moves them to the error folder. To start with i wasn't even aware of the jq command, i had to install the jq package in my machine to get this to work. Thanks a lot. Really appreciate the help. Commented May 4, 2018 at 16:22
  • @KavinPalaniswamy, you're welcome Commented May 4, 2018 at 17:16
  • Hey! There is a scenario when there is no such file , am getting a error message "jq: error: Could not open file *.json: No such file or directory" . For now am just suppressing it. Any way around it ? Commented May 10, 2018 at 2:31
  • @KavinPalaniswamy, it seems that you are not applying the above approach in exact manner. for f in *.json; will iterate through existed .json files (unless you don't have folders which end with .json) Commented May 10, 2018 at 5:13
  • Sorry for the delayed response. Well i think i didn't explain myself well. When the folder is completely empty and there are no json files i get the error :jq: error: Could not open file Test_*.json: No such file or directory . I have implemented the exact same code given by you. As a work around i am just check if any file exist and then am running your code. This does't throw any error. Any better way to implement this sir? Commented May 18, 2018 at 20:50