How to extract a specific information from a file
์กฐํ ์: 1 (์ต๊ทผ 30์ผ)
์ด์ ๋๊ธ ํ์
Hello all,
I have a large file containing data like this
INFO [07-05|15:18:04.004] ๐จ mined potential block number=1078 hash="f6d5bdโฆ58bea5"
INFO [07-05|15:18:04.004] Commit new mining work number=1079 sealhash="e686b6โฆbceb85" uncles=0 txs=0 gas=0 fees=0 elapsed="508.656ยตs"
INFO [07-05|15:18:06.004] Successfully sealed new block number=1079 sealhash="e686b6โฆbceb85" hash="b624ffโฆc743ae" elapsed=1.999s
INFO [07-05|15:18:06.004] ๐ block reached canonical chain number=1072 hash="92fe2fโฆfc6bf1"
INFO [07-05|15:18:06.004] ๐จ mined potential block number=1079 hash="b624ffโฆc743ae"
INFO [07-05|15:18:06.004] Commit new mining work number=1080 sealhash="c2f151โฆ17e0b6" uncles=0 txs=0 gas=0 fees=0 elapsed="515.946ยตs"
INFO [07-05|15:18:08.001] Successfully sealed new block number=1080 sealhash="c2f151โฆ17e0b6" hash="f65eabโฆ94b932" elapsed=1.996s
INFO [07-05|15:18:08.001] ๐ block reached canonical chain number=1073 hash="702ddeโฆ1fcf2a"
INFO [07-05|15:18:08.001] ๐จ mined potential block number=1080 hash="f65eabโฆ94b932"
INFO [07-05|15:18:08.002] Commit new mining work number=1081 sealhash="daee7dโฆ2444ae" uncles=0 txs=0 gas=0 fees=0 elapsed="545.658ยตs"
INFO [07-05|15:18:10.004] Successfully sealed new block number=1081 sealhash="daee7dโฆ2444ae" hash="baf0f0โฆ68ffa6" elapsed=2.002s
INFO [07-05|15:18:26.000] Successfully sealed new block number=1089 sealhash="d645c1โฆ1ed93b" hash="883415โฆ4510e6" elapsed=1.995s
INFO [07-05|15:18:26.000] ๐ block reached canonical chain number=1082 hash="67aa36โฆb89cd1"
INFO [07-05|15:18:26.000] ๐จ mined potential block number=1089 hash="883415โฆ4510e6"
I want to extract the information elasped (the one in s and not in ยตs). I have underlined it
Can somebody help me. Thanks alot
๋๊ธ ์: 0
๋ต๋ณ (1๊ฐ)
Apoorv Singh
2020๋
7์ 9์ผ
copy the whole text to a string. Then search for the keywork "elapsed". Consider the substring from this index till the end of each entry. Once you have this substring, you can further impose the condition that only values in seconds have to be considered.
This seems more like a hack than a nice solution, but I hope this helps :)
๋๊ธ ์: 1
์ฐธ๊ณ ํญ๋ชฉ
์นดํ ๊ณ ๋ฆฌ
Help Center ๋ฐ File Exchange์์ Language Support์ ๋ํด ์์ธํ ์์๋ณด๊ธฐ
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!