sample excel image I need export data from a column in excel and exclude some characters then export to a txt file.(excel Sample attached). Basically I need to extract ONLY names in the Orders column and output to a text file, here is what I have so far:
#Specify the Sheet name
$SheetName = "Today Order"
# Create an Object Excel.Application using Com interface
$objExcel = New-Object -ComObject Excel.Application
$objExcel.Visible = $false
# Open the Excel file and save it in $WorkBook
$WorkBook = $objExcel.Workbooks.Open($FilePath)
# Load the WorkSheet 'Change Auditor Events'
$WorkSheet = $WorkBook.sheets.item($SheetName)
#====
I can use the replace command below to trim off unneeded characters in the Orders column, I only need the names -replace "order from " -replace " California" How can I assign variable to the orders column and process each line then use the out-file to export? Or do you have any other good suggestion to do this.
Thanks in Advance.