Problem / Solution
Sometimes we need to import a file only after we know that it’s the right size or the right length. If the file falls short of a certain length or size, it may be because the file doesn’t contain all the data or is in a corrupt state. By adding a measure to check the size and length prior to importing we can prevent data problems. In this video, we will look at how to check the number of rows and the file size using two different methods. This video will show how you can incorporate pre-import checks to your processing using either PowerShell or C# code.
Key Learning Items
- Verify length in PowerShell.
- Verify size in PowerShell (MB or GB).
- Verify length in C#.
- Verify size in C# (MB or GB).
Read Companion Tip

Tim consults for FinTek Development and teaches the course Automating ETL on Udemy. He’s worked with technology since high school, helping his school win its first TCEA award and continues to work in automation, data architecture, back-end development, and smart contract architecture. Tim enjoys testing new technologies early in the diffusion of innovation curve and was an early adopter of NoSQL and smart contract development. He has a blog at http://www.fintekdev.com/ and helps contribute to local technical and financial events in Texas.