Help answer threads with 0 replies.
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, 01: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, 02:37 PM   #2
Registered: Aug 2012
Posts: 220

Original Poster
Rep: Reputation: Disabled
ended up using python
Old 03-28-2017, 02: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,248
Blog Entries: 15

Rep: Reputation: 1321Reputation: 1321Reputation: 1321Reputation: 1321Reputation: 1321Reputation: 1321Reputation: 1321Reputation: 1321Reputation: 1321Reputation: 1321
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 12:43 AM
[SOLVED] listing files recursively, sorted by time, limited head Harju Linux - Newbie 12 03-25-2011 10:51 AM
listing all the permissions recursively linuxfia Linux - General 4 10-31-2008 02:55 PM
Recursively listing files over FTP? overbored Linux - Software 4 10-14-2004 12:12 PM
recursively listing directories full paths kubicon Linux - Newbie 2 02-22-2004 03:55 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:40 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