I'm trying to read lines from a .txt and copy each line from the text to its own folder that was previously created with ARRAY
cat stores/locations.txt |while read -r LINE;do
echo "$LINE" > county/${ARRAY[${i}]}/localstores.txt
done
when I run this it creates only 1 file in the directory county with one line of contact information for the store but what i really want it to do is to put a file in each element of the ARRAY instead of the parent folder county.
each line of data includes the following:
<storeid> <storename> <amountofEmployees> <nameofManager>
I'm super stuck and really would appreciate the help!
county/${ARRAY[${i}]}/localstores.txtfiles. For that, you should be able to use>>redirection. Good luck.>>for append redirection? Good luck.