1 2 3 4 5 6 7 8
#!/bin/bash sed 's/|/ /g' train.txt > train.csv for i in {1..570} do grep "^[0-9]* $i " train.csv > products/p$(printf "%03d" $i) done