Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Create a directory list in CSV format' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create a directory list in CSV format
Authored by: davidefrank on Aug 30, '06 09:02:01AM

This breaks if the file name contains spaces - try this instead:

ls -lT | awk '{print "\""substr($0,index($0,$10))"\""";""\""$6" "$7", "$9"\""";""\""$5"\""}'

The nested substr/index functions of the awk command say: "get a substring of the entire line ($0), starting at the offset (index) of the tenth word, and continuing (by default) to the end of the line."



[ Reply to This | # ]