<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to Validate Blank Lines in CSV Files Using Microsoft Fabric Data Pipelines in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-to-Validate-Blank-Lines-in-CSV-Files-Using-Microsoft-Fabric/m-p/4892987#M13859</link>
    <description>&lt;DIV&gt;&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;I’m working on a requirement in &lt;STRONG&gt;Microsoft Fabric&lt;/STRONG&gt; where I need to validate CSV files (comma or pipe-delimited) stored in a &lt;STRONG&gt;Lakehouse&lt;/STRONG&gt;. The goal is to identify blank lines in two specific scenarios:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;H4&gt;&lt;STRONG&gt;Validation Rules&lt;/STRONG&gt;&lt;/H4&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Blank Lines Before the Header&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The first non-blank line should be treated as the header.&lt;/LI&gt;&lt;LI&gt;If any blank lines exist above the header, the file should be marked as &lt;STRONG&gt;invalid&lt;/STRONG&gt;.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Blank Lines After the Header&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Any blank rows in the data section should also make the file &lt;STRONG&gt;invalid&lt;/STRONG&gt;.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;DIV&gt;&lt;H4&gt;&lt;STRONG&gt;Additional Constraints&lt;/STRONG&gt;&lt;/H4&gt;&lt;UL&gt;&lt;LI&gt;The solution must be implemented &lt;STRONG&gt;entirely within Microsoft Fabric&lt;/STRONG&gt; (no Azure Data Factory).&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Dataflow Gen2 should not be used&lt;/STRONG&gt;.&lt;/LI&gt;&lt;LI&gt;Files should remain in the same folder; we only need an &lt;STRONG&gt;output response or log&lt;/STRONG&gt; indicating which files are valid or invalid.&lt;/LI&gt;&lt;/UL&gt;&lt;DIV&gt;&lt;P&gt;Could you please guide me on how to achieve this using &lt;STRONG&gt;Fabric Data Pipelines&lt;/STRONG&gt;? Your suggestions and best practices would be greatly appreciated—they keep learners like me motivated!&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 04 Dec 2025 11:12:55 GMT</pubDate>
    <dc:creator>Mamatha77</dc:creator>
    <dc:date>2025-12-04T11:12:55Z</dc:date>
    <item>
      <title>How to Validate Blank Lines in CSV Files Using Microsoft Fabric Data Pipelines</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-to-Validate-Blank-Lines-in-CSV-Files-Using-Microsoft-Fabric/m-p/4892987#M13859</link>
      <description>&lt;DIV&gt;&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;I’m working on a requirement in &lt;STRONG&gt;Microsoft Fabric&lt;/STRONG&gt; where I need to validate CSV files (comma or pipe-delimited) stored in a &lt;STRONG&gt;Lakehouse&lt;/STRONG&gt;. The goal is to identify blank lines in two specific scenarios:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;H4&gt;&lt;STRONG&gt;Validation Rules&lt;/STRONG&gt;&lt;/H4&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Blank Lines Before the Header&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The first non-blank line should be treated as the header.&lt;/LI&gt;&lt;LI&gt;If any blank lines exist above the header, the file should be marked as &lt;STRONG&gt;invalid&lt;/STRONG&gt;.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Blank Lines After the Header&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Any blank rows in the data section should also make the file &lt;STRONG&gt;invalid&lt;/STRONG&gt;.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;DIV&gt;&lt;H4&gt;&lt;STRONG&gt;Additional Constraints&lt;/STRONG&gt;&lt;/H4&gt;&lt;UL&gt;&lt;LI&gt;The solution must be implemented &lt;STRONG&gt;entirely within Microsoft Fabric&lt;/STRONG&gt; (no Azure Data Factory).&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Dataflow Gen2 should not be used&lt;/STRONG&gt;.&lt;/LI&gt;&lt;LI&gt;Files should remain in the same folder; we only need an &lt;STRONG&gt;output response or log&lt;/STRONG&gt; indicating which files are valid or invalid.&lt;/LI&gt;&lt;/UL&gt;&lt;DIV&gt;&lt;P&gt;Could you please guide me on how to achieve this using &lt;STRONG&gt;Fabric Data Pipelines&lt;/STRONG&gt;? Your suggestions and best practices would be greatly appreciated—they keep learners like me motivated!&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 04 Dec 2025 11:12:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/How-to-Validate-Blank-Lines-in-CSV-Files-Using-Microsoft-Fabric/m-p/4892987#M13859</guid>
      <dc:creator>Mamatha77</dc:creator>
      <dc:date>2025-12-04T11:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to Validate Blank Lines in CSV Files Using Microsoft Fabric Data Pipelines</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-to-Validate-Blank-Lines-in-CSV-Files-Using-Microsoft-Fabric/m-p/4893001#M13860</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1451782" data-lia-user-login="Mamatha77" class="lia-mention lia-mention-user"&gt;Mamatha77&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data quality validation is the "silent guardian" of any data platform.&lt;/P&gt;&lt;P&gt;You have a very specific "physical" validation requirement (detecting blank lines) rather than a "logical" one (checking column types). Because of this, &lt;STRONG&gt;Fabric Data Pipelines alone (using Get Metadata or Lookup activities) are not the right tool&lt;/STRONG&gt; for the actual validation logic. They cannot easily "see" a blank line before a header; they will simply try to parse the next line as the header or fail silently.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The Solution:&lt;/STRONG&gt; Use a &lt;STRONG&gt;Fabric Pipeline&lt;/STRONG&gt; to orchestrate the process, but offload the logic to a &lt;STRONG&gt;Fabric Notebook&lt;/STRONG&gt; (using Python).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You'll build a pipeline that:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Lists all CSV files&lt;/STRONG&gt; in a Lakehouse folder (using a Notebook).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;For each file:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Reads it &lt;STRONG&gt;as raw text&lt;/STRONG&gt; (not as a table).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Detects:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Blank lines before the header&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Blank lines in the data rows&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Logs each file as &lt;STRONG&gt;Valid&lt;/STRONG&gt; or &lt;STRONG&gt;Invalid&lt;/STRONG&gt; into a Lakehouse table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Pipeline orchestrates the notebook and refreshes the validation table.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it can help you !&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Antoine&lt;/P&gt;</description>
      <pubDate>Thu, 04 Dec 2025 11:20:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/How-to-Validate-Blank-Lines-in-CSV-Files-Using-Microsoft-Fabric/m-p/4893001#M13860</guid>
      <dc:creator>AntoineW</dc:creator>
      <dc:date>2025-12-04T11:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to Validate Blank Lines in CSV Files Using Microsoft Fabric Data Pipelines</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-to-Validate-Blank-Lines-in-CSV-Files-Using-Microsoft-Fabric/m-p/4893055#M13864</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1451782" data-lia-user-login="Mamatha77" class="lia-mention lia-mention-user"&gt;Mamatha77&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a really good quality-check requirement, but with the constraints you listed it’s important to be clear about what Fabric can and can’t do today.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Fabric &lt;STRONG&gt;Data Pipelines by themselves&lt;/STRONG&gt; (Copy, Lookup, Get Metadata, etc.) can see files and basic properties (name, size, modified time), but they &lt;STRONG&gt;cannot read file content line-by-line&lt;/STRONG&gt;. That means they can’t look inside a CSV and say “this line is blank”, “this is the header”, or “this row is empty after the header”.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Those kinds of checks need something that can actually parse the text — in Fabric that’s:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;a Notebook (Spark / Python), or&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Dataflow Gen2 (Power Query),&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;and you’ve already ruled out Dataflow Gen2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, staying fully inside Fabric and keeping the files in place, the realistic pattern is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;use a &lt;STRONG&gt;Data Pipeline&lt;/STRONG&gt; to orchestrate,&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;call a &lt;STRONG&gt;Notebook activity&lt;/STRONG&gt; that does the actual validation,&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;have the notebook write a small log table (e.g. csv_validation_log) in the Lakehouse with columns like file_path, is_valid, reason.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The notebook would just read each CSV as text, find the first non-blank line as the header, then check for blank lines before or after it and record the result for each file. The CSVs themselves stay where they are; only the log is written.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are not allowed to use &lt;STRONG&gt;notebooks either&lt;/STRONG&gt;, and the rule is “pipelines only, no Dataflow Gen2, no ADF, no external services”, then the honest answer is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the current features, Fabric Data Pipelines alone &lt;STRONG&gt;cannot&lt;/STRONG&gt; implement this exact validation, because there is no built-in activity that can inspect CSV content at the line level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In that case, the design would need to be relaxed slightly (for example, allow a small notebook just for validation) to be achievable purely in Fabric.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So just to summarise in plain terms:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Yes, you can do this &lt;STRONG&gt;inside Fabric&lt;/STRONG&gt; with a &lt;STRONG&gt;pipeline + notebook&lt;/STRONG&gt; and a validation log.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;No, you cannot do it with &lt;STRONG&gt;pipeline activities only&lt;/STRONG&gt; today, because they can’t look inside the file content.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;– Gopi Krishna&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Dec 2025 12:00:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/How-to-Validate-Blank-Lines-in-CSV-Files-Using-Microsoft-Fabric/m-p/4893055#M13864</guid>
      <dc:creator>Ugk161610</dc:creator>
      <dc:date>2025-12-04T12:00:19Z</dc:date>
    </item>
  </channel>
</rss>

