I tried to extract conditional strings using powershell as per below example.
Both $regex1 and $regex 2, i am able to get as a two text files. But i want output as pep OUTPUT file format.
But dont know what mistake i am making here. I new to powershell please help.
INPUT FILE(all.txt)
temp1.txt: file not found \xyz\ not found \123\
temp2.txt: text \ABC\ is here
temp2.txt: NUM \999\ yes \FIRST\
hi,
i have tried to copy the results in a file, below are the code. i have used “get content” to copy the output as text file but i cant make generate a text file.
$input = “E:\to be del q\SEQ\MILL-A-SEQ\all.txt”
$output_file = “E:\to be del q\SEQ\MILL-A-SEQ\del.txt”
Get-Content $input | ForEach-Object {
You should use the pre tags to format your code so it is readable.
Get-Content is for getting the content of an item, not a variable. Additionally [pscustomobject] is not a variable, it is a way to create a custom powershell object.
Is custom object being generated that contain the data you desire. Those object are sent to the pipeline and then take the Out-Default when the pipeline end with no other out alternative provide. If you want to output those object to a file, you just specify that in the pipeline.