Trying extract from text file and convert csv

I want to extract IP address, system ID and engine IDs of this file ( marked in red) and put in a csv. E.g.

1.1.1.1, SYSTEMID, 000012345678981123548912

I get these file by running an expect script from solaris.

Here is the text file output of my expect script.

working on 1.1.1.1
SNMP Engine ID         : 000012345678981123548912^M
*A:SYSTEMID# logout ^M
working on 1.1.1.1
SNMP Engine ID         : 000012345678981123548912^M
*A:SYSTEMID# logout ^M
working on 1.1.1.1
SNMP Engine ID         : 000012345678981123548912^M
*A:SYSTEMID# logout ^M
awk -F"[ ^]+" '/working/ {printf $3 ", SYSTEMID, ";getline;printf $5;print ""}' file >log.csv

cat log.csv
1.1.1.1, SYSTEMID, 000012345678981123548912
1.1.1.1, SYSTEMID, 000012345678981123548912
1.1.1.1, SYSTEMID, 000012345678981123548912

thanks jotne.
However I don't get the desired output. Here is what I'm getting.

cat log.csv
, SYSTEMID, 
, SYSTEMID, 
, SYSTEMID,

Can you post the contents of

head -n5 log.csv | od -c

I am suspicious there might be some other white chars in there.
Also use nawk instead of awk on Solaris.

you are right:

 head -n5 log.csv | od -c
0000000   ,       S   Y   S   T   E   M   I   D   ,      \n   ,       S
0000020   Y   S   T   E   M   I   D   ,      \n   ,       S   Y   S   T
0000040   E   M   I   D   ,      \n
0000047

also nawk worked:

 nawk -F"[ ^]+" '/working/ {printf $3 ", SYSTEMID, ";getline;printf $5;print ""}' file         
1.1.1.1, SYSTEMID, 000012345678981123548912
1.1.1.1, SYSTEMID, 000012345678981123548912
1.1.1.1, SYSTEMID, 000012345678981123548912

Thanks a lot !!

After code-tagged the content, its clearly seen that the file contains ^M
Which is probably caused by choosing binary ( the default) format while FTPing from windows to unix.
You can use dos2unix or similar utilities