I have a requirement to recursively move all files except empty files (0-byte files) to a destination folder while preserving hierarchies in a Databricks file system. Example:
folder_path/
1/
2/
file1.json- 0 byte
file2.json- 128 kb
3/
4/
file3.json- 0 byte
file4.json- 20 kb
outputs:
folder_path/
1/
2/
file2.jpg - 128 kb
3/
4/ file4.jpg - 20 kb
I'm able to implement this using shell script and AWK but it seems Databricks does not support AWK.
Is there any way to implement this either in Python or Scala using Databricks notebook ?