function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
chiranjib routchiranjib rout 

hii every one . please suggest me apex method to capture specific data form different line and column wise,ASP

here is the vf page code :
    <apex:page controller="importDataFromCSVController" >
    <apex:form >
        <apex:pagemessages />
        <apex:pageBlock >
            <apex:pageBlockSection columns="48" > 
                  <apex:inputFile value="{!csvFileBody}"  filename="{!csvAsString}"/>
                  <apex:commandButton value="Import Timesheet" action="{!importCSVFile}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
        <apex:pageBlock >
           <apex:pageblocktable value="{!applist}" var="app">
              <apex:column value="{!app.Avvas_id__c}" />
              <apex:column value="{!app.Total_Number_of_Hours_worked__c}" />
              <apex:column value="{!app.Total_Cleint_Holidays__c}" />
              <apex:column value="{!app.Total_Number_of_Days_worked__c}" />
              <apex:column value="{!app.Total_billable_days__c }" />
       
        </apex:pageblocktable>
     </apex:pageBlock>
   </apex:form>
</apex:page>

controller:

public class importDataFromCSVController {
public Blob csvFileBody{get;set;}
public string csvAsString{get;set;}
public String[] csvFileLines{get;set;}

public List<appointment__c> applist{get;set;}
  public importDataFromCSVController(){
    csvFileLines = new String[]{};
    applist = New List<appointment__c>(); 
  }
  
  public void importCSVFile(){
       try{
           csvAsString = csvFileBody.toString();
           csvFileLines = csvAsString.split('\n'); 
            
           for(Integer i=1;i<csvFileLines.size();i++){
               appointment__c appObj = new appointment__c () ;
               string[] csvRecordData = csvFileLines[i].split(',');
               appObj.Avvas_id__c = csvRecordData[0] ;             
               appObj.Total_Number_of_Hours_worked__c = Decimal.Valueof(csvRecordData[1]);
               appObj.Total_Cleint_Holidays__c = Decimal.Valueof(csvRecordData[2]);
               appObj.Total_Number_of_Days_worked__c = Decimal.Valueof(csvRecordData[3]);                                                                            
               applist.add(appObj);   
           }
        //insert acclist;
        }
        catch (Exception e)
        {
            ApexPages.Message errorMessage = new ApexPages.Message(ApexPages.severity.ERROR,'An error has occured while importin data Please make sure input csv file is correct');
            ApexPages.addMessage(errorMessage);
        }  
  }
}
   
User-added image


In this csv file i want to capture specific data like  ID =A-006,
Total_Number_of_Hours_worked= 60
Total_Cleint_Holidays= 1
Total_Number_of_Days_worked= 18
chiranjib routchiranjib rout
 anyone suggest  for  apex method to capture  specific data index wise from a csv file