Posts

Showing posts with the label html-table

Combine for loop with cat and json2html

Combine for loop with cat and json2html I try to convert json files to html files. So I can later import them to the website. My idea is run json2table to create a table and write then to the html directory. But I find not out how can redirecting the output of json2table. for file in $(ls json/*.json); do cat $file | json2table > html/$file.html; done But this end with bash: html/json/26.json.html: No such file or directory Is there someone which can help to fix the error? Thank you Silvio Check content of $file and html/$file.html in your loop. – Cyrus Jul 1 at 19:27 $file html/$file.html 3 Answers 3 Your ${file} includes the json directory. When you don't have a directory html/json the redirection will fail. I think you have a subdir html ...