Answers.Body: <p>Assuming that you're talking about the CSV importer, there is a configuration option called <code>line_filter</code> where you can provide a regular expression to skip a line if it doesn't match it. The &quot;line&quot; given to <code>preg_match()</code> is a standardized csv string. See <a href="https://github.com/Project60/org.project60.banking/blob/0.7/extension/CRM/Banking/PluginImpl/Importer/CSV.php#L128-L135" rel="nofollow noreferrer">here</a>.</p>
  <p>Additionally, there's also another (and even older) line filter mechanism based on the <code>filter</code> attribute, see <a href="https://github.com/Project60/org.project60.banking/blob/0.8-alpha8/extension/CRM/Banking/PluginImpl/Importer/CSV.php#L275-L288" rel="nofollow noreferrer">here</a>. However this approach has mostly been abandoned in favour of the more flexible <code>regex</code> based approach. However, it's still in the code for backwards compatibility, and there are still examples using it, see e.g. <a href="https://docs.civicrm.org/banking/en/latest/configuration/plugins/importers/csv/" rel="nofollow noreferrer">here</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-17T14:15:19.173Z
Answers.Text: Great - this is what I was searching for!
Answers.UserDisplayName: Detlev Sieber
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-30T18:43:19.100Z
Answers.Text: The solution is not obvious - therefore some more detail here:
  
  1. Using the regex approach ("filter") is a good idea!
  2. We have to set a regex filter for two kind of lines:
      a) The lines that should be imported
      b) The heading line!
  3. Be aware, that the heading might contain the character ";" , which is not allowed.
Answers.UserDisplayName: Detlev Sieber
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-17T13:31:01.770Z
Answers.LastActivityDate: 2021-09-03T07:49:54.003Z
Answers.LastEditDate: 2021-09-03T07:49:54.003Z
Answers.UserDisplayName: Björn Endres
Answers.Body: <p>Another way of doing this, is to operate with two bank accounts. One that is processed in CiviCRM, and one for transactions that normally shouldn’t be processed in CiviCRM. Only have the first one as bank files, and then you have solve it</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-10T19:09:52.783Z
Answers.LastActivityDate: 2021-08-10T19:09:52.783Z
Answers.UserDisplayName: Flying
Body: <p>Use Case: The bank statement might contain some payments, that should NOT AT ALL get into CiviCRM (e.g. salary payments).</p>
  <p>Is there an easy way to make the importer plugin skip certain lines?</p>
  <p>Best
  Detlev</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-06T08:12:52.943Z
Comments.Text: Thanks for drawing my attention to Civibanking - looks very useful. From a quick look at the user guide https://docs.civicrm.org/banking/en/latest/user-guide/ the Analysing Stage gives an example of "the payment has nothing to do with CiviCRM" which is what I think you want.
Comments.UserDisplayName: Mick Kahn
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-07T09:16:54.847Z
Comments.Text: Thanks for your answer! However, this would work, but in this case is not enough: The bank statements contain some payments, that should never be stored within CiviCRM because they shall not be visible to unauthorized people. (i.e. CiviCRM users with access to CiviContribute and CiviBanking, but with no access to salary information).
Comments.UserDisplayName: Detlev Sieber
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-07T17:49:14.247Z
Comments.Text: Looking a bit more at the extension, I don't think its possible. CiviBanking is an extension to CiviCRM so if you really don't want it in CiviCRM at all then you will need it before importing the file. A quick look at the extension doesn't seem to have any speciific CiviBanking permissions so you can't limit to a specific user, which might be acceptable. But someone properly familiar with the extension may know more so I won't call this a answer yet. Hope there is a way.
Comments.UserDisplayName: Mick Kahn
Tags: <civibanking>
Title: CiviBanking - Skip certain payment entries when importing
ThreadText: # CiviBanking - Skip certain payment entries when importing
  
  (Asked by: username_0 on 2021-08-06)
  
  Use Case: The bank statement might contain some payments, that should NOT AT ALL get into CiviCRM (e.g. salary payments).
  
  Is there an easy way to make the importer plugin skip certain lines?
  
  Best
  username_0
  
  **Tags:** civibanking
  
  > **Comments:**
  > **username_1**: Thanks for drawing my attention to Civibanking - looks very useful. From a quick look at the user guide https://docs.civicrm.org/banking/en/latest/user-guide/ the Analysing Stage gives an example of "the payment has nothing to do with CiviCRM" which is what I think you want.  
  > **username_0**: Thanks for your answer! However, this would work, but in this case is not enough: The bank statements contain some payments, that should never be stored within CiviCRM because they shall not be visible to unauthorized people. (i.e. CiviCRM users with access to CiviContribute and CiviBanking, but with no access to salary information).  
  > **username_1**: Looking a bit more at the extension, I don't think its possible. CiviBanking is an extension to CiviCRM so if you really don't want it in CiviCRM at all then you will need it before importing the file. A quick look at the extension doesn't seem to have any speciific CiviBanking permissions so you can't limit to a specific user, which might be acceptable. But someone properly familiar with the extension may know more so I won't call this a answer yet. Hope there is a way.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2021-08-17. Score: 4
  
  Assuming that you're talking about the CSV importer, there is a configuration option called `line_filter` where you can provide a regular expression to skip a line if it doesn't match it. The "line" given to `preg_match()` is a standardized csv string. See [here](https://github.com/Project60/org.project60.banking/blob/0.7/extension/CRM/Banking/PluginImpl/Importer/CSV.php#L128-L135).
  
  Additionally, there's also another (and even older) line filter mechanism based on the `filter` attribute, see [here](https://github.com/Project60/org.project60.banking/blob/0.8-alpha8/extension/CRM/Banking/PluginImpl/Importer/CSV.php#L275-L288). However this approach has mostly been abandoned in favour of the more flexible `regex` based approach. However, it's still in the code for backwards compatibility, and there are still examples using it, see e.g. [here](https://docs.civicrm.org/banking/en/latest/configuration/plugins/importers/csv/).
  
  > **Comments:**
  > **username_0**: Great - this is what I was searching for!  
  > **username_0**: The solution is not obvious - therefore some more detail here:  1. Using the regex approach ("filter") is a good idea! 2. We have to set a regex filter for two kind of lines:     a) The lines that should be imported     b) The heading line! 3. Be aware, that the heading might contain the character ";" , which is not allowed.  
  
  ---
  
  ### Answer by username_3 on 2021-08-10. Score: 0
  
  Another way of doing this, is to operate with two bank accounts. One that is processed in CiviCRM, and one for transactions that normally shouldn’t be processed in CiviCRM. Only have the first one as bank files, and then you have solve it
  
  
  ---
  
  