Download deleteEmptyColumnsFromCSV.pl_0.txt

In Novell Log Manager, a user can export search results as a CSV file. Usually the generated CSV has more than 300+ columns corresponding to the 300+ event fields in a Sentinel schema of which more than 200+ columns may be empty.

So you may have data in the 1st column and data in 300th column but you need to scroll across all those empty columns in between to even see the data. Moreover Open Office, Excel, Google Docs most often throw up an error while trying to open a CSV file with so many columns.

To solve this problem, I have written a simple perl script that removes all the empty columns from the specified input file and writes it to the specified output file. After which the resultant output file can be looked at and edited easily in any of the editors.

To run this script, simply open up a terminal in Linux and type –

perl Input_CSV_Filename Output_Filename

Substitute Input_CSV_Filename with the name of the CSV file from which you want empty columns to be removed and Output_Filename with name of the file to which the output needs to be written.

0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.

Disclaimer: As with everything else at NetIQ Cool Solutions, this content is definitely not supported by NetIQ, so Customer Support will not be able to help you if it has any adverse effect on your environment.  It just worked for at least one person, and perhaps it will be useful for you too.  Be sure to test in a non-production environment.

Leave a Reply

No Comments
By: bputtali
Oct 27, 2009
12:17 pm
Active Directory Authentication Automation Cloud Computing Cloud Security Configuration Customizing Data Breach DirXML Drivers End User Management Identity Manager Importing-Exporting / ICE/ LDIF Intelligent Workload Management IT Security Knowledge Depot LDAP Monitoring Open Enterprise Server Passwords Reporting Secure Access Supported Troubleshooting Workflow