Changeset ef9d209 in sasview for sansdataloader/src/sans/dataloader


Ignore:
Timestamp:
Aug 26, 2011 4:42:32 PM (13 years ago)
Author:
Jae Cho <jhjcho@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
8285a93
Parents:
dcbd4e2c
Message:

added csv format: but read floats only but not strings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansdataloader/src/sans/dataloader/readers/ascii_reader.py

    rad8034f ref9d209  
    3535    type = ["ASCII files (*.txt)|*.txt", 
    3636            "ASCII files (*.dat)|*.dat", 
    37             "ASCII files (*.abs)|*.abs"] 
     37            "ASCII files (*.abs)|*.abs", 
     38            "CSV files (*.csv)|*.csv"] 
    3839    ## List of allowed extensions 
    39     ext = ['.txt', '.TXT', '.dat', '.DAT', '.abs', '.ABS' 
     40    ext = ['.txt', '.TXT', '.dat', '.DAT', '.abs', '.ABS', 'csv', 'CSV' 
    4041     
    4142    ## Flag to bypass extension check 
     
    120121                lentoks = 2      
    121122                for line in lines: 
    122                     toks = line.split() 
     123                    toks = line.split(',') 
     124                    if len(toks) < 2: 
     125                        toks = line.split() 
    123126                    try: 
    124127                        #Make sure that all columns are numbers. 
Note: See TracChangeset for help on using the changeset viewer.