Some document said emacs-lisp is more powerful than perl/Python to parser text file, but I still didn't see good example for reference.
For example, if input below text block:
12-22 07:43:14.699 1640 2722 E JavaBinder: at android.util.ArrayMap.allocArrays(ArrayMap.java:175)
12-22 07:43:14.699 1640 2722 E JavaBinder: at android.util.ArrayMap.put(ArrayMap.java:463)
12-22 07:43:14.699 1640 2722 E JavaBinder: at android.os.BaseBundle.putInt(BaseBundle.java:455)
12-22 07:43:14.699 1640 2722 E JavaBinder: at android.content.Intent.putExtra(Intent.java:7174)
12-22 07:43:14.699 1640 2722 E JavaBinder: at com.android.server.audio.AudioService$VolumeStreamState.setIndex(AudioService.java:4289)
12-22 07:43:14.699 1640 2722 E JavaBinder: at com.android.server.audio.AudioService.setStreamVolumeInt(AudioService.java:1929)
12-22 07:43:14.699 1640 2722 E JavaBinder: at com.android.server.audio.AudioService.onSetStreamVolume(AudioService.java:1670)
12-22 07:43:14.699 1640 2722 E JavaBinder: at com.android.server.audio.AudioService.setStreamVolume(AudioService.java:1769)
12-22 07:43:14.699 1640 2722 E JavaBinder: at com.android.server.audio.AudioService.setStreamVolume(AudioService.java:1683)
I wish to produce below output: (extract the file name, function name and line number, then reformat as plantuml input text)
-> AudioService:setStreamVolume():1683
AudioService -> AudioService:setStreamVolume():1769
AudioService -> AudioService:onSetStreamVolume():1670
AudioService -> AudioService:setStreamVolumeInt():1929
AudioService -> AudioService:setStreamVolumeInt():4289
AudioService -> Intent:putExtra():7174
Intent -> BaseBundle:putInt():455
BaseBundle -> ArrayMap:put():463
ArrayMap -> ArrayMap:allocArrays():175
Then we can use plantuml to covert it to a UML diagram (org mode).
How can we do that with emacs-lisp (maybe in org mode)?
My idea is put the input text in a code block, then run the emacs-lisp code in another code block. The result will be the output as expected above
#+NAME: myinput
#+BEGIN_EXAMPLE :session
input text here
#+END_EXAMPLE
#+BEGIN_SRC emacs-lisp :exports both
(message 'process myinput here')
#+END_SRC
#+RESULTS:
: output reformat result here