Replacing Date in the file with Create date and timestamp

Hello,
I have files that with a naming convention as shown below. Some of the files have dates in the file name and some of them don't have dates in the file name.

imap-hp-import-20150917.txt
imap-dell-gec-import-20150901.txt
imap-cvs-import-20150915.txt
imap-gec-import.txt
imap-home-depot-import.txt

So the file naming convention is:
imap-clientname-import-YYYYMMDD.txt

All I am trying to do is: to get the ClientName and Date from the file name. If the Filename does not have dates in their file name, then we put file create date and time.

Also, the output need to be written in a output file with pipe delimitation if possible.

So the output I am looking for is pipe delimitation: clientname and date

hp | 20150917
dell-gec | 20150901
cvs | 20150915
gec | "need a create file date here"
home-depot | "need a create file date here"

I tried something below to get the date. I am getting the desired output. But how to replace it with create date for the files that does not have dates in the filename.

ls -1 imap-*.txt | awk -F"." '{print $1}' | awk -F"-" '{print $NF}'

Below is the output I am getting from above code:

20150917
20150901
20150915
import
import

Thanks

Try

la imap* | awk '
BEGIN   {for (n=split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec", M); n>0; n--) MNr[M[n]]=n
        }
        {sub (/\.txt/,"")
         n=split ($NF, T, "-")
         if (T[n] == "import" || T[n] == "")    {n++
                                                 T[n]=sprintf ("2015%02d%02d", MNr[$6], $7)}
         print T[2] (n==5?"-"T[3]:"") " | " T[n]
        }
'
cvs | 20150915
dell-gec | 20150901
gec | 20150917
home-depot | 20150917
hp | 20150917

Thank you RudiC for the response. I tried the suggested code but getting the error message below. Also, "la" is not a recognizable command hence changed it to "ls -1" . I am using Sun Solaris. Sorry for not mentioning it earlier.
Also, the date which I trying to replace is the create date of the file and not the sysdate.

ls-1 imap* | awk '
BEGIN   {for (n=split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec", M); n>0; n--) MNr[M[n]]=n
        }
        {sub (/\.txt/,"")
         n=split ($NF, T, "-")
         if (T[n] == "import" || T[n] == "")    {n++
                                                 T[n]=sprintf ("2015%02d%02d", MNr[$6], $7)}
         print T[2] (n==5?"-"T[3]:"") " | " T[n]
        }
'
awk: syntax error near line 4
awk: illegal statement near line 4
awk: syntax error near line 8
awk: illegal statement near line 8

Would appreciate any help on this.

Thanks

use nawk on Solaris instead of awk.
Or as an alternative:

ls -1 imap* | nawk -F "(-import[.]*)|([.])" '{print substr($1,index($1,"-")+1),(NF==2)?"need a create file date here":sqrt($(NF-1)^2)}' OFS='|'

Thank you Vgersh99 for the reply.
It is working fine. The only thing I need in this "need a create file date here" to be replaced by that file creation date on unix system in YYYYMMDD format.

ls -1 imap* | nawk -F "(-import[.]*)|([.])" '{print substr($1,index($1,"-")+1),(NF==2)?"need a create file date here":sqrt($(NF-1)^2)}' OFS='|'

Thanks again and appreciate your time and help.

Do you have ' stat ' on your system?
which stat

Unfortunately I do not have stat .

Would we be able to use ls -Eu and grab the date.

Thanks

here's the solution with the stat:

BEGIN {
  FS="(-import[.]*)|([.])"
  OFS="|"
}
function fileC(fileName,   cmd,line, lineA)
{
   cmd="stat -c %w " fileName
   cmd | getline line; close(cmd)
   split(line, lineA, " ")
   gsub("-", "",lineA[1])
   return(lineA[1])
}
{
  print substr($1,index($1,"-")+1),(NF==2)?fileC($0):sqrt($(NF-1)^2)
}

I don't have Solaris at my disposal. What's the output of 'ls -Eu'?
Usually 'file creation time' is not readily available....

---------- Post updated at 04:10 PM ---------- Previous update was at 03:49 PM ----------

here's an alternative with perl:
ls -1 imap* | nawk -f saan.awk where saan.awk is:

BEGIN {
  FS="(-import[.]*)|([.])"
  OFS="|"
}
function fileC(fileName,   cmd,line, lineA)
{
   #cmd="stat -c %w " fileName
   cmd="perl -e '@d=localtime ((stat(shift))[10]); printf \"%4d%02d%02d\n\", $d[5]+1900,$d[4]+1,$d[3]' " fileName
   cmd | getline line; close(cmd)
   split(line, lineA, " ")
   gsub("-", "",lineA[1])
   return(lineA[1])
}
{
  print substr($1,index($1,"-")+1),(NF==2)?fileC($0):sqrt($(NF-1)^2)
}

Sorry, my fault - la is an alias for ls -l (lower case L). So - try

ls -l imap* | awk '...