2009/7/20 damien clochard <damien@dalibo.info>:
> Mike a écrit :
[...]
>> I used the following command to gather all file and directory names.
>> "/abc" is the main directory on the linux samba server where all
>> company data is located:
>>
>> root@acme:/# ls -Ralh /abc > /home/mike/file_output.txt
If you just want the file paths, using "find" might make things easier
to deal with:
# find /abc -type f -print >/home/mike/file_output.txt
>> file_output.txt is 33 megs. and lists approximately 650,000 file names
>> and their directory paths.
>>
>> I want to pull all the file name info. and directory path info. from
>> "file_output.txt" and place each file name into a postgresql database
>> along with the related file location information.
>> The ultimate goal is to be able to make an alpha-numeric query and be
>> presented with matching file names and their location on the samba
>> server.
>>
>> How do I pull the data from "file_output.txt" and place it into the
>> postgres database?
If you use "find" as mentioned above, then you can do this to get the
file and directory information by splitting on the last "/".
--
Michael Wood <esiotrot@gmail.com>