Search in paragraph's text: Difference between revisions

J
(J)
Line 121:
</lang>
Note : 1st awk is used to search for an expression (regular or not) within paragraphs, and 2nd awk is used for formatting
 
=={{header|J}}==
 
Implementation:
 
<lang J>NB. read file, separate on blank lines
paragraphs=: ((LF,LF)&E. <;.2 ])fread 'traceback.txt'
 
NB. ignore text preceeding Traceback (most recent call last)
cleaned=: {{y}.~{.I.'Traceback (most recent call last)'&E.y}}each paragraphs
 
NB. limit to paragraphds containing SystemError
searched=: (#~ (1 e.'SystemError'&E.)every) cleaned
 
NB. add paragraph separator and display
echo ;searched ,L:0 '----------------',LF</lang>
 
{{out}}
<pre>Traceback (most recent call last):
vmodl.fault.SystemError: (vmodl.fault.SystemError) {
dynamicType = ,
dynamicProperty = (vmodl.DynamicProperty) [],
msg = 'A general system error occurred: Unable to complete Sysinfo operation. Please see the VMkernel log file for more details.: Sysinfo error: Bad parameterSee VMkernel log for details.',
faultCause = ,
faultMessage = (vmodl.LocalizableMessage) [],
reason = 'Unable to complete Sysinfo operation. Please see the VMkernel log file for more details.: Sysinfo error: Bad parameterSee VMkernel log for details.'
}
----------------
Traceback (most recent call last):
[Tue Jan 21 16:16:19.252221 2020] [wsgi:error] [pid 6515:tid 3041002528] [remote 10.0.0.12:50757] SystemError: unable to access /home/dir
[Tue Jan 21 16:16:19.249067 2020] [wsgi:error] [pid 6515:tid 3041002528] [remote 10.0.0.12:50757] mod_wsgi (pid=6515): Failed to exec Python script file '/home/pi/RaspBerryPiAdhan/www/sysinfo.wsgi'.
[Tue Jan 21 16:16:19.249609 2020] [wsgi:error] [pid 6515:tid 3041002528] [remote 10.0.0.12:50757] mod_wsgi (pid=6515): Exception occurred processing WSGI script '/home/pi/RaspBerryPiAdhan/www/sysinfo.wsgi'.
----------------
Traceback (most recent call last): 11/01 18:24:57.728 ERROR| traceback:0013| File "/tmp/sysinfo/autoserv-0tMj3m/common_lib/log.py", line 70, in decorated_func 11/01 18:24:57.729 ERROR| traceback:0013| fn(*args, **dargs) 11/01 18:24:57.730 ERROR| traceback:...
----------------
Traceback (most recent call last):
File "/usr/lib/vmware-vpx/vsan-health/pyMoVsan/VsanClusterPrototypeImpl.py", line 1492, in WaitForUpdateTask
WaitForTask(task)
File "/usr/lib/vmware-vpx/pyJack/pyVim/task.py", line 123, in WaitForTask
raise task.info.error
vmodl.fault.SystemError: (vmodl.fault.SystemError) {
dynamicType = ,
dynamicProperty = (vmodl.DynamicProperty) [],
msg = 'A general system error occurred: Unable to complete Sysinfo operation. Please see the VMkernel log file for more details.: Sysinfo error: Bad parameterSee VMkernel log for details.',
faultCause = ,
faultMessage = (vmodl.LocalizableMessage) [],
reason = 'Unable to complete Sysinfo operation. Please see the VMkernel log file for more details.: Sysinfo error: Bad parameterSee VMkernel log for details.'
}
----------------
</lang>
 
=={{header|Phix}}==
6,951

edits