I have a log file as below,
011122111128 :16267281288 :40586200370017022 :947700000622 :919400146760221 :SSD :4065376D : :9477000006 :9170120275030 :210 :18 :002919544716189 :unknown :unknown :unknown
I need to print each line(always I need to get last 50 records) with a comma-separated line then I can import it as a CSV file. Here is the required output.
011122111128,16267281288,40586200370017022,947700000622,919400146760221,SSD,4065376D,,9477000006,9170120275030,210,18,002919544716189,unknown,unknown,unknown
Here is what I tried but this prints the first value only and it not takes the last 50 records also. Can someone help me with the below?
awk -F ':' '{print $1}' /log
always I need to get last 50 records
? Do you need to separate by a comma the last 50 records of each line (so from columns 1 to 49 will not be separated by a comma)? – Edgar Magallon Nov 01 '22 at 07:07Questions Section
. I was able to found your question by usinghttps://unix.stackexchange.com/questions/723200
(I typed the number) and there are more recent questions whose can be acceded by changing723200
for723199
for example. – Edgar Magallon Nov 01 '22 at 07:12