I have a folder of about 10 thousand files and I need to write a bash shell script that will pull a COLUMN of data out and put it in a file. Help??? Please and thank you!
EDIT To Include:
#!/bin/bash
cd /Users/Larry/Desktop/TestFolder
find . -maxdepth 1 -mindepth 1 -type d
sed '4q;d'
A separate attempt
for dir in /Users/Larry/Desktop/TestFolder
do
dir=${dir%*/}
sed -n '4q;d' > Success.txt
done
The files are comma separated value files that open in a spreadsheet program like Numbers or Excel in a spreadsheet. I want to extract a single column from each file but there are at least 10 thousand files in each folder so arguments give to error "too long".
Another attempt
find /Users/Larry/Desktop/modified -type f -maxdepth 1 -name '.csv' -print0 | xargs -0 awk -F '","' {print $2}' find /Users/Larry/Desktop/modified -type f -maxdepth 1 -name '.csv' -print0 | xargs -0 awk -F '"*,*' '{print $2}' > DidItWorkThisTime.csv
The link to a previous question does not work for large sets of files.