![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help in removing commas | ali560045 | Shell Programming and Scripting | 1 | 04-21-2009 04:04 AM |
| How do i remove commas(,) & spaces | anushree.a | Linux | 5 | 05-26-2008 03:39 AM |
| Removing empty spaces and adding commas | jazz | High Level Programming | 4 | 11-13-2006 09:54 AM |
| Removing trailing spaces from delimited files | djkane | Shell Programming and Scripting | 6 | 03-29-2006 07:11 AM |
| removing commas from text file | hcclnoodles | UNIX for Dummies Questions & Answers | 6 | 03-26-2003 04:43 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
parsing log files, removing spaces and replace with commas
Hello all
i am working on a database to import log files from my systems, but i cannot seem to find the answer. I searched here for a good bit and couldnt peice together what i was looking for. I know you could do this with awk, i just dont know how. Any help would be greatly appreciated. ok, so take for instance the /var/adm/messages file: Jun 5 08:40:02 SunNiprS1 usba: [ID 349649 kern.info] PLEXTOR Corp. USB Storage Adapter 004400947B Jun 5 08:40:02 SunNiprS1 genunix: [ID 936769 kern.info] scsa2usb0 is /pci@1e,600000/usb@a/cdrom@2 Jun 5 08:40:02 SunNiprS1 genunix: [ID 408114 kern.info] /pci@1e,600000/usb@a/cdrom@2 (scsa2usb0) online Jun 5 08:41:09 SunNiprS1 scsi: [ID 193665 kern.info] sd16 at scsa2usb0: target 0 lun 0 Jun 5 08:41:09 SunNiprS1 genunix: [ID 936769 kern.info] sd16 is /pci@1e,600000/usb@a/cdrom@2/disk@0,0 Jun 5 08:41:35 SunNiprS1 genunix: [ID 408114 kern.info] /pci@1e,600000/usb@a/cdrom@2/disk@0,0 (sd16) online all i want to do is seperate each field by a comma, i thought it would be pretty easy...but i am having a difficult time with it. Some sample output would look like this: Jun 5, 08:40:02, SystemName, usba: [ID 349649 kern.info], PLEXTOR Corp. USB Storage Adapter 004400947B Jun 5, 08:40:02, SystemName, genunix: [ID 936769 kern.info], scsa2usb0 is /pci@1e,600000/usb@a/cdrom@2 thank you |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|