Extracting Directory listing to spreadsheet

Discussion in 'Mac Basics and Help' started by tsaxer, Jul 22, 2008.

  1. tsaxer macrumors regular

    Joined:
    Feb 24, 2004
    Location:
    Tuscaloosa, AL
    #1
    I'm not sure if this is the right board, but here goes...
    I'm trying to find a way to put the path information of a lot (1000's) of sound files into a spreadsheet. The files are part of an experiment we are working on, and is organized in a 2-level folder (SoundFiles/person/speed/filename.wav).
    Is there a way to do this? I've tried google, but I'm not quite sure what to search.
     
  2. cptpower macrumors regular

    cptpower

    Joined:
    Sep 10, 2007
    Location:
    Calgary, AB
    #2
    what exactly do you want the output to look like?

    Am I correct in assuming that the folders look like:

    SoundFiles/person0/speed0/filename_x.wav
    SoundFiles/person0/speed0/filename_y.wav
    SoundFiles/person0/speed1/filename_x.wav
    SoundFiles/person0/speed1/filename_y.wav
    SoundFiles/person1/speed0/filename_x.wav
    SoundFiles/person1/speed0/filename_y.wav
    ...

    Or something to that effect?
     
  3. tsaxer thread starter macrumors regular

    Joined:
    Feb 24, 2004
    Location:
    Tuscaloosa, AL
    #3
    Yes, that is the general format. In each speed there are 210-250 files, So I would like to have a representation of what exists in the folders.
     
  4. cptpower macrumors regular

    cptpower

    Joined:
    Sep 10, 2007
    Location:
    Calgary, AB
    #4
    try the following in the SoundFiles directory in terminal:

    Code:
    find . -type f
    That should get you some output that'll be easy enough to put into a spreadsheet. You can even go a step further, pipe the output to text file, replace the '/' between each directory with ',' and turn it into a csv file to make the import of the data that much easier.

    Hope that helps.
     

Share This Page