using command line input in C code

Hi

I need to list files by their size and exclude those that match a certain size. With grep it is easy enough.

ll -rt | grep 2166 | awk '{print $9}'

2166 is the filesize and $9 the filenamefield.

What should I be looking for to use this in a C program? My aim is to cut the name field of the files and match that up with report names and only show reports which have been populated.

command line input in c code can be inserted using the execve() command.
you could make a process that executes the first command and then sends the results through a pipe to a child that executes the second command and so on. The final child should print out the result you want.
it's just an idea.

You might also be able to use the native C library to check file specific information, like fstat(), etc. to determine file size, do a man fstat.