fanout .csv file processor

  generate files and dirs quickly
  tested with MacOS (Sequoia)


S Binder 2026


<- home


fanout can be used for:

{1} reading a .csv file and writing its contents to the console (stdout/terminal)

{2} gathering statistics of a .csv file: line count, max and min line length etc

{3} reading single columns of a .csv file

{4} reading a single column of a .csv file and creating a new text file for each entry found

{5} reading a single column of a .csv file and creating a new subdirectory for each entry found



use 2 arguments (read-only operations)

{1}

fanout read <filename>

=> output the file contents to the console

{2}

fanout stats <filename>

=> output to the console:
   absolute path to the .csv file
   line count (of the .csv file)
   character counts of the shortest and longest line (of the .csv file)


examples :: use 2 arguments (read-only operations)

Suppose we have a .csv file called example.csv, containing the following lines:

id,first,second,third
100,A,X,abc
200,B,Y,cde
300,C,Z,fgh



command:

fanout read example.csv

output:
id,first,second,third
100,A,X,abc
200,B,Y,cde
300,C,Z,fgh



command:

fanout stats example.csv

output:
file: /absolute_path/to/example.csv
lines: 4
length of shortest line: 11 chars
length of longest line: 21 chars




use 3 arguments

{3}

fanout read <filename> <column_number>

=> output the column contents to the console
   (this is a read-only operation)


{4}

fanout create_files <filename> <column_number>

fanout touch <filename> <column_number>

(these 2 commands are equivalent)

=> create a new subdirectory with the
   same name as <filename>
   (without the file extension)
=> in the new subdirectory,
   create a single text file for each of
   the values (lines) found in the specified column
=> long filenames will be truncated
   (max file name length: 64 characters)
   CAUTION: this is a read & write operation!


{5}

fanout create_dirs <filename> <column_number>

fanout create_directories <filename> <column_number>

fanout mkdir <filename> <column_number>

(these 3 commands are equivalent)

=> create a new subdirectory with the
   same name as <filename>
   (without the file extension)
=> in the new subdirectory,
   create a single directory for each of
   the values (lines) found in the specified column
=> long filenames will be truncated
   (max file name length: 64 characters)
   CAUTION: this is a read & write operation!


examples :: use 3 arguments

Suppose we have a .csv file called example.csv, containing the following lines:

id,first,second,third
100,A,X,abc
200,B,Y,cde
300,C,Z,fgh



command (0 being the index/number of the first column):

fanout read example.csv 0

output:
100
200
300



command (column number 4 does not exist in the example.csv file):

fanout read example.csv 4

output:
(column 4 not found in row)
(column 4 not found in row)
(column 4 not found in row)



command:

fanout create_files example.csv 1


output:
File created. Name -> A
File created. Name -> B
File created. Name -> C

3 new files created.

All new files located in ./_example

---

Above command run again (note: we do not overwrite existing files):

command:

fanout create_files example.csv 1

output:
File exists. (No new file created!) Name found in .csv file -> A
File exists. (No new file created!) Name found in .csv file -> B
File exists. (No new file created!) Name found in .csv file -> C

No new files created.



command:

fanout create_dirs example.csv 1

output:
Subdirectory created. Name -> A
Subdirectory created. Name -> B
Subdirectory created. Name -> C

3 new directories created.

All new directories located in ./_example

---

Above command run again (note: we do not overwrite existing files):

command:

fanout create_dirs example.csv 1

output:
Subdirectory exists. (No new subdirectory created!) Name found in .csv file -> A
Subdirectory exists. (No new subdirectory created!) Name found in .csv file -> B
Subdirectory exists. (No new subdirectory created!) Name found in .csv file -> C

No new directories created.




How to start working with fanout

no installation required
download the executable (link below)

drop the .csv file (containing the data that you want to work with)
and the executable into the working directory, and execute the required command

(better: copy the program into /usr/local/bin
 which will allow you to run the program
 without worrying about the path to the current working directory)

GENTLE WARNING: avoid using this program if you are not familiar
with working on the command line!

Program not running?

set _execute_ permissions for yourself (as usual, use chmod)


Did MacOS give you a warning about a failed malware check? Run:

% xattr -l <filename>


If you see something about com.apple.quarantine, e.g.

com.apple.quarantine: <a quarantine string>

Run:

% xattr -d com.apple.quarantine <filename>

Check the SHA256 sum of the downloaded file (see below)!

SHA256

% sha256 fanout SHA256 (fanout) = d15c55a3398921fe2600bbf9a8b05e4c73250513ed3d985cfc22f280f019ff94