I am reading a text file where I need to filter out and perform some formatting if a row starts in a string and ends in a number. If i had known/fix values, I could use StartWith or EndsWith to filter this line. I tried using it as below but I guess that's wrong as it didn't work.
if(($record.StartsWith.GetType() -eq [string]) -and ($record.EndsWith.GetType() -eq [int]))
Example: My rows read
TransDate,Merchant,Amount
Doe,Jane, *6098
3/4/2020,Walmart,6.45
3/4/2020,Starbucks,14.45
Doe,John, *6096
3/4/2020,Amazon,34.45
I need to be identify that row 2 and 5 have my card numbers. How can I identify these in powershell? Let me know please. Thanks