powershell - How to pull data from specific column from imported CSV -
I have this CSV file:
The procedure for the day name is PID Operation Path Results 52: 24.3 Notepad.exe 4828 Process Issue Breakthrough 52: 24.3 Notepad.EXE 4828 Create Thread Success 52: 24.3 Notepad.exa 4828 Load Image C: \ Windows \ Systemof \ Notepad.exe Success
I import the file into a variable:
$ csvContent = import-CSV D: \ Logfile.CSV
Trying to pull out "PID":
$ csvContent [0] | PID
but it does not work
How do I convert data from the PID column to the variable Can i remove
There is no comma in that CSV file, and it assigns all the headers as the title of the single header Importing
You have to specify / specify a digitizer for the elements in the file.
For example:
daytime, process name, PID, operation, path, result 52: 24.3, notepad XE, 4828, Process Start, Success 52: 24.3, Notepad.exe, 4828, Create Thread, Success 52: 24.3, Notepad.ax, 4828, Load Image, C: \ Windows \ System 32 \ Notepad.ax, Success
Comments
Post a Comment