title: How to skip a few initial rows while parsing CSV using jackson-dataformat-csv?
body: <p>I have a CSV of the following format:</p>
  
  <pre><code>New CSV file
  
  header_1,header_2,header_3,header_4
  value_1,value_2,value_3,value_4
  value_1,value_2,value_3,value_4
  value_1,value_2,value_3,value_4
  </code></pre>
  
  <p>I have the following code for parsing this CSV:</p>
  
  <pre><code>    CsvMapper csvMapper = new CsvMapper();
      CsvSchema schema = CsvSchema.emptySchema().withSkipFirstDataRow(true);
      List&lt;CsvModel&gt; rows = new LinkedList&lt;&gt;();
      MappingIterator&lt;CsvModel&gt; iterator = csvMapper
              .readerFor(CsvModel.class).with(schema)
              .readValues(filePath.toFile());
      while (iterator.hasNext()) {
          CsvModel csvElement = iterator.next();
          if (StringUtils.isBlank(csvElement.getValue1())) {
              // skip lines not having the value
              continue;
          }
          rows.add(csvElement);
      }
  </code></pre>
  
  <p>However, I am getting the following exception while parsing the above mentioned CSV-format file:</p>
  
  <pre><code>com.fasterxml.jackson.databind.RuntimeJsonMappingException: Can not construct instance of com.adapters.CsvParsing: no String-argument constructor/factory method to deserialize from String value ('')
   at [Source: com.fasterxml.jackson.dataformat.csv.impl.UTF8Reader@2cb566f1; line: 2, column: 1]
  </code></pre>
  
  <p>This is because the second line is empty. I need to skip the first two lines, how do I tell jackson to skip the first two lines of the file?</p>
  
  <p><strong>Edit 1:</strong>
  Here is the CsvModel file:</p>
  
  <pre><code>@JsonIgnoreProperties(ignoreUnknown = true)
  @JsonInclude(JsonInclude.Include.NON_EMPTY)
  public class CsvModel {
      public static final String IdField = "Id";
      public static final String NameField = "Name";
      public static final String GuidField = "Guid";
      public static final String SubscriptionNameField = "Subscription Name";
      public static final String DateField = "Date";
      public static final String CostField = "Cost";
  
      @JsonProperty(IdField)
      private String Id;
      @JsonProperty(NameField)
      private String Name;
      @JsonProperty(GuidField)
      private String Guid;
      @JsonProperty(SubscriptionNameField)
      private String SubscriptionName;
      @JsonProperty(DateField)
      private String Date;
      private Long epochDate;
      @JsonProperty(CostField)
      private Double Cost;
  
      public String getId() {
          return this.Id;
      }
  
      public void setId(String id) {
          this.Id = id;
      }
  
      public String getName() {
          return this.Name;
      }
  
      public void setName(String name) {
          this.Name = name;
      }
  
      public String getGuid() {
          return this.Guid;
      }
  
      public void setGuid(String guid) {
          this.Guid = guid;
      }
  
      public String getSubscriptionName() {
          return this.SubscriptionName;
      }
  
      public void setSubscriptionName(String subscriptionName) {
          this.SubscriptionName = subscriptionName;
      }
  
      public String getDate() {
          return this.Date;
      }
  
      public void setDate(String date) {
          this.Date = date;
      }
  
      public Long getEpochDate() {
          return this.epochDate;
      }
  
      public void setEpochDate(Long epochDate) {
          this.epochDate = epochDate;
      }
  
      public Double getCost() {
          return this.Cost;
      }
  
      public void setCost(Double cost) {
          this.Cost = cost;
      }
  }
  </code></pre>