How to know the line number of a physical dataset row?

Hi all, I have a physical dataset based on a NFS directory containing csv files.
I would like to filter the rows according to the line number in the files, in order to get all the headers.
I tried something like :


with cte as (

select

to_timestamp(cast($mtime as double)/1000.) as file_timestamp_utc

,$file as file_path

,columns

from table( cbp.chrglperiod.rtjreco."rterecof_v1"( type=>'text' ))

qualify row_number() over(partition by $file) = 1

)

select * from cte

order by file_path

This does not work on a directory based dataset, but works on a file based dataset.

Is there a way to access the line number of a row (like a $rowid column), like we can access the file name ($file) ?

Thanks !