When importing from text to Excel, I have seen many tips to overcome Excel's limit. My problem is different, I want to set a (small) limit myself, because what I want is to preview the data in some huge files. Therefore I need to ask Excel to import the data up to some number of rows (say 100 rows, or eventually setting any other limit, such as total count of bytes to read from the input file, or total cell count, anything).
I know a way to create a query connection that drops some columns, but what I want is a way to truncate while preserving all the columns.
Besides, VBA is not an option. I repeat the operation many times with different files and formats, I just need a handy trick to preview quickly with Excel using "Import From Text".
Any tips? Thanks is advance.
One simple approach could be to use PowerShell to create previews of the files.
For example executing the following PoSh pipeline in the folder with some big CSV files (but could be any text files) would create rather small preview files of them.
Get-ChildItem *.csv | % {
$fn = $_.BaseName + '.preview' + $_.Extension;
$_ | Get-Content -First 100 | Out-File $fn
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With