Created
January 31, 2023 20:14
-
-
Save fahadysf/6ed87fc67105ad6301782608a539081f to your computer and use it in GitHub Desktop.
There ya go!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$input_file = ".\sample.txt" | |
$output_file = ".\out.txt" | |
$text = Get-Content $input_file -Raw | |
$text | select-string '"[^\"]+"' -AllMatches | Foreach-Object {$_.Matches} | Foreach-Object { $text = $text.replace($_.Groups[0].Value, $_.Groups[0].Value.replace(' ', '_'))} | |
echo $text | |
echo $text > $output_file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment