0

I have 7th column with values like:

OS:J:\output\Windows\System32\winevt\Logs\Security.evtx
OS:J:\output\Windows\System32\winevt\Logs\System.evtx

I want to extract information by reading values backward and put in a new column.

Values to be extracted in a new column, lets say "location" should look like:

Location
Security.evtx
System.evtx
  • 1
    What exactly do you want, everything after the last ``? What is the relevance of "7th" column in this question? – RalfFriedl May 31 at 21:24
1
$ awk -F'\' '{print $7}' inputfile
  • It might be useful to replace $7 with $NF. – Cyrus May 31 at 21:24
  • I thought about doing that, but the request was specifically for the seventh field, and so what's what I provide. – DopeGhoti May 31 at 21:55
0

As checked Last column is $7 Used below command to extract the values

command

sed -r 's/.*\\//g' filename

output

Security.evtx
System.evtx
  • sed 's/.*\\//' file is sufficient, because * is greedy. Why -r? – seshoumara Jun 1 at 13:15
0
awk -F ' / ' '{print $7} yourfilename

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.