Results 1 to 2 of 2

Thread: Reading excel files and placing the data into a .csv file

  1. #1
    Join Date
    Feb 2016
    Posts
    55
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default Reading excel files and placing the data into a .csv file

    Hi,

    I am using c# and I am trying to read excel files, one row at a time, determining if the row is blank, a title or general data the returning it to a csv file. I have outlined code that I have been writing but I don't think I am quite there yet. I am also trying to check blank rows a number of times before finishing or/and throwing exceptions if incorrect data or empty file. I still think I have more to do, but if anyone can help, it would be appreciated.

    Code:
    Records = openExcelFile
    List<csv> csv
    
    Foreach (record in records)
    {
                   
                   rowType = ValiateRow(record);
    
                   switch (rowTYpe)
                   {
                                  Case RowType.Header:
                                                 Continue;           
                                  Case RowType.Blank:
                                                 blankRows++;
                                                 if (blankRows > maxBLankRows)
                                                                return;   
                                                 else
                                                                continue;           
                                  Case RowType.Valid:
                                                 CSV csv = ConvertTOCsv(record)
                                                 If (daf!= null)
                                                    Daff.add(csv);
                                                 Continue;
                   }              // End switch
    
    }  // Foreach record
    Last edited by kwood30; 02-27-2018 at 09:38 AM.

  2. #2
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    507
    Thanks
    9
    Thanked 59 Times in 57 Posts

    Default

    (Admin) - Think this should belong in the 'Other' section. It is C# and not ASP. Can be wrong tho.
    -DW [Deadweight]
    Resolving your thread: First Post: => EDIT => Lower right: => GO ADVANCED => Top Advance Editor drop down: => PREFIX:Resolved

Similar Threads

  1. reading text files
    By benslayton in forum ASP
    Replies: 0
    Last Post: 09-21-2007, 01:28 AM
  2. Reading a file and analyzing data...
    By Rockonmetal in forum PHP
    Replies: 0
    Last Post: 09-05-2007, 12:46 AM
  3. Replies: 1
    Last Post: 05-07-2007, 04:08 PM
  4. placing files
    By chechu in forum HTML
    Replies: 8
    Last Post: 03-15-2007, 04:11 PM
  5. Replies: 12
    Last Post: 09-26-2006, 10:01 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •