Check if there is record in excel csv file and email using Windows scripting

shmz
shmz used Ask the Experts™
on
Hi

I like to check if there is any record in my csv file, ignoring header.
And if exist then email the csv file. Doesn't matter in which format file being emailed.

Thanks in advance
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016
Commented:
$size = get-content '.\bulk_input.csv'
if ($size.Count -gt 1){
Write-Output 'sending email'
<#
Send-Email -To recipient@example.com -From sripts@example.com 
            -Attachment .\bulk_input.csv 
            -body "more than just the header present" 
            -ExchangeServer yourexchangeserveraddress 
            -Credential yourcredentails

or

Send-Email -To "someone@somewhere.com" -From 'script@example.com' `
           -Subject 'Response from Script'  -Attachment ".\bulk_import.csv" `
           -IsOffice365Account -Credential $office365Credential
#>   
}

Open in new window

Author

Commented:
Thank you

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial