How can I create a data file with one column in which there will be 1000 rows with zero values?something like:output:00000...
how to CREATE a column with zero values in shell?
shell;text processing
Simply,printf '0\n%.0s' {1..1000}or using for loop,for i in {1..1000}; do echo 0; doneusing awk,awk 'BEGIN{for(c=0;c<1000;c++) print 0}'As @StphaneChazelas pointed out, Using {1..1000} requires zsh or recent versions of bash, yash or ksh93 and also means storing the whole range in memory (possibly several times). You'll find it becomes a lot slower (if it doesn't crash for OOM) than using awk or yes 0 | head ... for large ranges like {1..10000000}. Or in other words it doesn't scale well. Possible workaround would be to use for ((i=0; i<=10000000;i++)); do echo 0; done (ksh93/zsh/bash) wouldn't have the memory issue but would still be orders of magnitude slower than a dedicated tool or real programming language approach.