Click here to Skip to main content
15,896,278 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

I have a file with variable row length like this:

MAMMOGRAPHY INC,XXXXX1706,XXXXXXXX4708,
ABC INC.,XXXXX0742,XXXXXX2401,

I need to store the "MAMMOGRAPHY INC" in a data table as Name and K2CLICK INC should also be saved in the same data table as Name...Is there a way where these can be done in the same logic.Please help.

Thanks.
Posted
Comments
Jibesh 13-Mar-13 16:07pm    
was these information are available as line by line... ?
[no name] 13-Mar-13 16:10pm    
First, what does sorting have to do with your question? Second, where is this K2CLICK INC coming from? Third, what have you tried? Did you try Split? SubString?

1 solution

Since you didnt give alot of info i will do my best,

From the sample you provided,

MAMMOGRAPHY INC,XXXXX1706,XXXXXXXX4708,
ABC INC.,XXXXX0742,XXXXXX2401,

It appears your dealing with comma separated values. Your best bet is to split on the comma

http://www.dotnetperls.com/split[^]

And the store the values in the appropriate columns in your database, with an insert

http://www.w3schools.com/sql/sql_insert.asp[^]

or an update

http://www.w3schools.com/sql/sql_update.asp[^]

Hope that helps,
 
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