Free for all

Download csvparser.pl_.txt

This is a very simple PERL script that may be quite useful when working with delimited text files, especially for those of you who write/maintain Delimited Text drivers in IDM. You can use it in a few different ways:

  • Convert a file from one delimiter to another
  • Parse a file to make sure each field has quotes around it (instead of only those with spaces)
  • Recreate your file but only specific columns
  • Recreate your file with the columns in any order you want
  • All of the above combined

If you’re good with the Linux command line tools, combine this script with grep, sed, awk, wc, etc. to do all sorts of things. I wrote it so that I could quickly look through a large CSV file I get from our HR system and return only the fields I want. For example, using this script and other built in tools I can quickly figure out how many active employees we have within a specific business unit without having to load the CSV into a database and query it that way.

The script was written for Linux, but seems to work in Windows too (tested using Active Perl base installation).

CSV Parser v1.0.2 - Parse data from a delimited text file.

Usage: -c [file]

   -c | --csv [File]            Specify a CSV with the input data

   -i | --inputdelim [char]     Input file delimiter (Default: ",")
   -o | --outputdelim [char]    Output using different delimiter (Default: ",")
   -f | --fields [#,#,#,#]      Fields to print (base 0) - Order will be maintained. (Default: All)
   -q | --quotes                Include quotes around the fields (Default: Off)
   -h | --help                  Help!
   -d | --deubg                 Enable debugging info
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
Dec 8, 2011
12:46 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