I have been spending the last couple of days trying to create this script, but am having some difficulties getting it to work.
The scenario:
I have a program that exports a csv file with information about several customers. This program cannot split the information into several csv files for each customer. This is what I need my script to do.
Sample output from csv:
Domain,Computer,IP Address,Scheduled Scan Exclusion List (Directories),Connection Status,OPP,Update Agent,Architecture,Client Program,Smart Scan Agent Pattern,Virus Pattern,IntelliTrap Pattern,IntelliTrap Exception Pattern,Virus Scan Engine,Spyware Pattern,Spyware Active-monitoring Pattern,Spyware Scan Engine,Virus Cleanup
Customer1,PC01,192.168.1.1,34567,Online,Disabled,Disabled,x86,10.0,,7.251.00,0.133.00,0.551.00,9.120.1004,9.43,0.943.00,6.2.3015,1082,6.3.1015,2.8.1084,2.8.1080,1.171.00,1.252.00,1.184.00,1.185.00,08-06-2010 11:35:47,
Customer1,PC02,10.70.10.1,34567,Online,Disabled,Disabled,x86,10.0,,7.251.00,0.133.00,0.551.00,9.120.1004,9.43,0.943.00,6.2.3015,1082,6.3.1015,2.8.1084,2.8.1080,1.171.00,1.252.00,1.184.00,1.185.00,08-06-2010 11:35:47,
Customer2,PC01,192.168.1.1,34567,Online,Disabled,Disabled,x86,10.0,,7.251.00,0.133.00,0.551.00,9.120.1004,9.43,0.943.00,6.2.3015,1082,6.3.1015,2.8.1084,2.8.1080,1.171.00,1.252.00,1.184.00,1.185.00,08-06-2010 11:35:47,
Customer2,PC02,10.70.10.1,34567,Online,Disabled,Disabled,x86,10.0,,7.251.00,0.133.00,0.551.00,9.120.1004,9.43,0.943.00,6.2.3015,1082,6.3.1015,2.8.1084,2.8.1080,1.171.00,1.252.00,1.184.00,1.185.00,08-06-2010 11:35:47,
Now I need this script to split Customer 1 and 2 into 2 seperate csv files, and in this process remove several of the attributes.
My idea is to create a two-dimensional array, where I can choose what attributes I want in the new csv files (Domain, Computer, IP, Pattern).
It seems to me that this is a lot more complicated than I initially thought it would be.
Any suggestions, changes, or other ideas are appreciated.
The scenario:
I have a program that exports a csv file with information about several customers. This program cannot split the information into several csv files for each customer. This is what I need my script to do.
Sample output from csv:
Domain,Computer,IP Address,Scheduled Scan Exclusion List (Directories),Connection Status,OPP,Update Agent,Architecture,Client Program,Smart Scan Agent Pattern,Virus Pattern,IntelliTrap Pattern,IntelliTrap Exception Pattern,Virus Scan Engine,Spyware Pattern,Spyware Active-monitoring Pattern,Spyware Scan Engine,Virus Cleanup
Customer1,PC01,192.168.1.1,34567,Online,Disabled,Disabled,x86,10.0,,7.251.00,0.133.00,0.551.00,9.120.1004,9.43,0.943.00,6.2.3015,1082,6.3.1015,2.8.1084,2.8.1080,1.171.00,1.252.00,1.184.00,1.185.00,08-06-2010 11:35:47,
Customer1,PC02,10.70.10.1,34567,Online,Disabled,Disabled,x86,10.0,,7.251.00,0.133.00,0.551.00,9.120.1004,9.43,0.943.00,6.2.3015,1082,6.3.1015,2.8.1084,2.8.1080,1.171.00,1.252.00,1.184.00,1.185.00,08-06-2010 11:35:47,
Customer2,PC01,192.168.1.1,34567,Online,Disabled,Disabled,x86,10.0,,7.251.00,0.133.00,0.551.00,9.120.1004,9.43,0.943.00,6.2.3015,1082,6.3.1015,2.8.1084,2.8.1080,1.171.00,1.252.00,1.184.00,1.185.00,08-06-2010 11:35:47,
Customer2,PC02,10.70.10.1,34567,Online,Disabled,Disabled,x86,10.0,,7.251.00,0.133.00,0.551.00,9.120.1004,9.43,0.943.00,6.2.3015,1082,6.3.1015,2.8.1084,2.8.1080,1.171.00,1.252.00,1.184.00,1.185.00,08-06-2010 11:35:47,
Now I need this script to split Customer 1 and 2 into 2 seperate csv files, and in this process remove several of the attributes.
My idea is to create a two-dimensional array, where I can choose what attributes I want in the new csv files (Domain, Computer, IP, Pattern).
It seems to me that this is a lot more complicated than I initially thought it would be.
Any suggestions, changes, or other ideas are appreciated.