Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have to import data from a csv file which contains records of users. the problem i face here is to verify that all required field is present. I need to check that all the lines contains the USER NAME(or some other values....).if the line contains all the fields then i need to store it into a table USERS else if any of the fields are missing then it should be stored in another table ERROR_USERS.

eg:
id name password dept
1, sushil, asdfgghh, rnd
2, shakun, , rnd.

from above csv file
first record should be stored to the table USERS
and second should be stored to ERROR_USERS(as it doesn't contain the password field)
Posted
Updated 10-Oct-11 0:18am
v3

1 solution

I think there is no default tools to validate the CSV files. You can read and check the CSV files' fields using the SCRIPT task and using Precedence Constraint, you can redirect the flow whether to insert to Error Table or Main table. Hope i have helped a lil bit.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900