Jump to content

Powershell help kavali


gundugadu

Recommended Posts

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

Link to comment
Share on other sites

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"
}
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...