Writesite with all layers

I am trying to extract all layers data as csv file, but ALL variable for LAYER is not working.
I tried foreach command but it might not work as well.
Is there any solution? I can make scripts for all layers but it is not efficient.

image
image

writesite does not support output for multiple layers, so the LAYER environment variable controlling which layer should be output does not recognize keyword “ALL”. You could certainly write a script that loops over layers and for each iteration 1) sets the LAYER variable to a different layer, 2) sets a different OUTFILE, and 3) calls the writesite executable. The exact syntax for implementing something like this will depend on which shell you’re using to write your scripts. Or, as you noted, you could create individual scripts for processing each layer.