AWK end of line question

Any clues on how to parse a line returned from an ls command that allows for the filename to be fully passed even if it includes spaces? What I got close with is:
ls -ltra | awk '{print $1 "|" $3 "|" $4 "|" $5 "|" $6 "|" $7 "|" $8 "|" $9 $10 $11 $12 ... (etc)}'
However this clears the spaces in the filename and metls the name... Basically anything beyond the 9th field can be lumped into one variable for full printing or whatever...

Any other suggestions?

Thanks!

you can use for loop inside awk starting from field 9, since file names from ls -ltr output starts at field 9
eg

.... | awk '{
  for ( i=9 ; i<=NF;i++) {
  # find some way to concat to become file name
 } 
}'

and unless you want to do some other things with the various columns of ls -l , you can do away with -l (or use -1 ) instead to just get the file name.

ls -tra | ...... 
or
for files in *
do
  # do something with "$files"
done 

Thanks, the for loop cleans up the processing as does using OFS for the output delimiter. The problem is still the filename or at least being able to determine the starting location of the filename for use in a substr operation....

any thoughts?

U can try something like this:

ls -ltra| awk '{
                    for (i=1;i<=NF;i++)
                       {
                       if ( i > 8 )
                          printf("%s ",$i)
                       else
                          printf("%s|",$i)
                       }
                       printf("\n")
                    }'

Yee hah!!! We have a winner!!!

Thanks Klashxx

touch "this is a file with spaces in  it"
ls -1 this* | [n]awk '{print "\""$0"\""}'

This worked great for returning just the name, but doesn't work so well with an ls -ltra for instance to show me owner and other information.

I did like the enclosed quoting - that will come in handy I'm sure...

Thanks