I've got a project where I'm trying to collect all the files on a linux system into a CSV to be dumped into a DB.
my script has
FIND_CMD $TARGET $OPTS -xdev $FS -printf "%h,%f,%y,%s,%TY-%Tm-%Td %TH:%TM:%.2TS\n"
$FIND_CMD $TARGET $OPTS -xdev $FS -printf "\"%h\",\"%f\",\"%y\",\"%s\",\"%TY-%Tm-%Td %TH:%TM:%.2TS\"\n"
Consider using NUL as a delimiter in your CSV since that is not a valid character in a Linux filename/pathname - Wikipedia refernce.
That is also the reason that the
find command provides
-print0 and that tools such as Perl and GNU Parallel have corresponding switches giving rise to:
find . -name '*.orig' -print0 | perl -n0e unlink
find . -print0 | parallel -0 ...