-1

I am saving an excel file as .csv file which makes it have the style of:

58884,1,2912,3,,0,0,3_A,05-May-11,3,5,2,7.18161941, 

so it makes all the columns separated by commas. When I read the array I have the data being put into a float array. How can I separate the commas from the numbers I really want? Thanks for the help!

Iharob Al Asimi
  • 52,653
  • 6
  • 59
  • 97
ReconIII
  • 3
  • 3
  • 3
    Welcome to stackoverflow.com. Please take some time to read [the help pages](http://stackoverflow.com/help), especially the sections named ["What topics can I ask about here?"](http://stackoverflow.com/help/on-topic) and ["What types of questions should I avoid asking?"](http://stackoverflow.com/help/dont-ask). Also please [read about how to ask good questions](http://stackoverflow.com/help/how-to-ask). You might also want to learn how to create a [Minimal, Complete, and Verifiable Example](http://stackoverflow.com/help/mcve). – Some programmer dude Jun 26 '15 at 13:07
  • 1
    @Reconlll , You can edit your question to correct typos and everything. You'll get better responses if you add what you have tried, your code, etc – Spikatrix Jun 26 '15 at 13:08
  • 1
    @ReconIII what numbers you **really want**, there are a lot of numbers. – Iharob Al Asimi Jun 26 '15 at 13:11
  • and a couple of things that aren't numbers at all – Tom Tanner Jun 26 '15 at 13:18

1 Answers1

3

In your case I suggest the following 2 steps:

  1. Split the arrays by commas
  2. Check if every part splited is an number, if yes, add it to the array.

You can find here a good solution about how to split the string. For checking if the string obtained is a valid number see this.

Community
  • 1
  • 1
A B
  • 497
  • 2
  • 9