Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
| Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 25th, 2008, 02:55 PM
Registered User
 
Join Date: Dec 2007
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default count the string from csv format

Hi

I want to count the string from csv format e.g.
1,14,14,15,,5,5,15,5

now the result should be
count(1) =1
count(14)=2
count(15)=2
count(5)=3

Any Idea?









 
Old March 25th, 2008, 03:16 PM
Friend of Wrox
 
Join Date: Mar 2007
Location: Hampshire, United Kingdom.
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
Default

I would say split the string by the comma (String.Split(',')) and then add each item to a dictionary collection, the key being the number, the value being the count.

I think that would work quite nicely? :)

Rob
The Developing Developer
Currently Working Towards: MCAD C#
My Blog: http://www.robzyc.spaces.live.com
<center>"Nothing can stop the man with the right mental attitude from achieving his goal;
nothing on earth can help the man with the wrong mental attitude".

Thomas Jefferson</center>




Similar Threads
Thread Thread Starter Forum Replies Last Post
Change excel into csv format Ivanchan Excel VBA 4 July 5th, 2007 02:02 AM
Exporting Report to CSV format. chakravarthy_vr Reporting Services 4 March 20th, 2006 07:27 AM
Html > csv format goldspider Beginning PHP 2 March 27th, 2005 06:39 PM
Is there a component to change file to csv format? greatProject ADO.NET 0 November 11th, 2004 12:20 PM
exporting to csv format dazednconfused Beginning PHP 1 July 11th, 2003 03:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.