gundugadu Posted August 7, 2019 Report Posted August 7, 2019 naku oka folder lo excel files vunnay and with single generic script, is there a way to convert all excel files to seperate pipe delimited files. C# tho kuda cheyochu anna parledu Quote
tennisluvr Posted August 7, 2019 Report Posted August 7, 2019 clear-host write-host "Please Drag and Drop your CSV in the console Window and press enter" $input = read-host "Source" clear-host write-host "Please enter your export path" write-host "The default output location is your desktop [$($env:userprofile)]" -ForegroundColor Yellow write-host "Leave the input blank for the default location and just press ENTER" -ForegroundColor Yellow $output = read-host "Output Location" if(-not($ouput) -or (test-path $ouput)){$output = "$env:userprofile\desktop"} try{ import-csv $input -ErrorAction Stop | Export-Csv $output -Delimiter "|" -ErrorAction Stop } catch{ write-warning "Please contact support and provide the following error message" $error[0] write-host " Support email: [email protected] " -ForegroundColor Blue -BackgroundColor White read-host "Press ENTER to exit" } Quote
tennisluvr Posted August 7, 2019 Report Posted August 7, 2019 Just now, tennisluvr said: clear-host write-host "Please Drag and Drop your CSV in the console Window and press enter" $input = read-host "Source" clear-host write-host "Please enter your export path" write-host "The default output location is your desktop [$($env:userprofile)]" -ForegroundColor Yellow write-host "Leave the input blank for the default location and just press ENTER" -ForegroundColor Yellow $output = read-host "Output Location" if(-not($ouput) -or (test-path $ouput)){$output = "$env:userprofile\desktop"} try{ import-csv $input -ErrorAction Stop | Export-Csv $output -Delimiter "|" -ErrorAction Stop } catch{ write-warning "Please contact support and provide the following error message" $error[0] write-host " Support email: [email protected] " -ForegroundColor Blue -BackgroundColor White read-host "Press ENTER to exit" } Check this link https://community.spiceworks.com/topic/2129444-powershell-script-to-make-csv-pipe-delimited Quote
tennisluvr Posted August 7, 2019 Report Posted August 7, 2019 Let me know if you run into any issues and what the error is if you encounter it. I am new to PowerShell myself but working on getting better at it Quote
gundugadu Posted August 7, 2019 Author Report Posted August 7, 2019 2 hours ago, tennisluvr said: clear-host write-host "Please Drag and Drop your CSV in the console Window and press enter" $input = read-host "Source" clear-host write-host "Please enter your export path" write-host "The default output location is your desktop [$($env:userprofile)]" -ForegroundColor Yellow write-host "Leave the input blank for the default location and just press ENTER" -ForegroundColor Yellow $output = read-host "Output Location" if(-not($ouput) -or (test-path $ouput)){$output = "$env:userprofile\desktop"} try{ import-csv $input -ErrorAction Stop | Export-Csv $output -Delimiter "|" -ErrorAction Stop } catch{ write-warning "Please contact support and provide the following error message" $error[0] write-host " Support email: [email protected] " -ForegroundColor Blue -BackgroundColor White read-host "Press ENTER to exit" } Thanks baa will try the code and let you know 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.