#!/usr/bin/perl use strict; use warnings; open (DATA,"/tmp/messages.csv") || die 'Unable to write to file'; while () { chomp; my (@cols) = split(/\s+/, $_, 6); print TMP join(',',@cols), "\n"; } close TMP; close DATA; __DATA__ Oct 1 13:23:25 smoothwall-swe3 kernel: Allocating PCI resources starting at 10000000 (gap: 08000000:f6c00000) Oct 1 13:23:25 smoothwall-swe3 kernel: Built 1 zonelists Oct 1 13:23:25 smoothwall-swe3 kernel: Kernel command line: BOOT_IMAGE=SmoothWall ro root=804 ramdisk_size=8192 no-scroll panic=30 Oct 1 13:23:25 smoothwall-swe3 kernel: Enabling fast FPU save and restore... done. Oct 1 13:23:25 smoothwall-swe3 smoothd: Loading Plugins for Module "/usr/lib/smoothd/sysinstall.so #### Oct,1,13:23:25,smoothwall-swe3,kernel:,Allocating PCI resources starting at 10000000 (gap: 08000000:f6c00000) Oct,1,13:23:25,smoothwall-swe3,kernel:,Built 1 zonelists Oct,1,13:23:25,smoothwall-swe3,kernel:,Kernel command line: BOOT_IMAGE=SmoothWall ro root=804 ramdisk_size=8192 no-scroll panic=30 Oct,1,13:23:25,smoothwall-swe3,kernel:,Enabling fast FPU save and restore... done. Oct,1,13:23:25,smoothwall-swe3,smoothd:,Loading Plugins for Module "/usr/lib/smoothd/sysinstall.so