Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-28-2017, 02:45 PM   #1
Registered: Aug 2012
Posts: 220

Rep: Reputation: Disabled
recursively listing files' first lines

hey guys,

i have a directory tree structure with files that looks like this

inside each of the csv files there is a header field separated by csv

for example: dog.csv would have as its header fields
dog1, dog2, dog3
and for colors.csv would have as its header fields
red, white, blue
and for car.csv would have as its header fields
Ford, Chevy, Dodge

when i use
find * -exec cat {}/;
find * print0 | xargs -0 cat
i get a listing, but it's a mess and not easily readable!

I would like the output something more human readable, maybe something like this, but I'm open to other human readable results.

    dog1, dog2, dog3
    red, white, blue
    Ford, Chevy, Dodge
note: my system does not have tree as a command.
I'm guessing that it will take some sort of an awk script

thanks for whatever help you might give!

Old 03-28-2017, 03:37 PM   #2
Registered: Aug 2012
Posts: 220

Original Poster
Rep: Reputation: Disabled
ended up using python
Old 03-28-2017, 03:41 PM   #3
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,521
Blog Entries: 15

Rep: Reputation: 1481Reputation: 1481Reputation: 1481Reputation: 1481Reputation: 1481Reputation: 1481Reputation: 1481Reputation: 1481Reputation: 1481Reputation: 1481
Can you share your code so someone in future with similar question can find it?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Recursively listing files using bash builtins Neville Hillyer *BSD 3 01-21-2016 01:43 AM
[SOLVED] listing files recursively, sorted by time, limited head Harju Linux - Newbie 12 03-25-2011 11:51 AM
listing all the permissions recursively linuxfia Linux - General 4 10-31-2008 03:55 PM
Recursively listing files over FTP? overbored Linux - Software 4 10-14-2004 01:12 PM
recursively listing directories full paths kubicon Linux - Newbie 2 02-22-2004 04:55 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:32 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration