# [CentOS] Conversion of text in shell

John R Pierce pierce at hogranch.com
Sat Oct 13 00:00:49 UTC 2007

Ross S. W. Walker wrote:
> Ross S. W. Walker wrote:
>
>> roland hellström wrote:
>>
>>> OK! I finally figured out the solution for all you people out
>>> the eager to hear it!!!
>>> it was infact very very similar to the last line I sent...
>>>
>> this is it
>>
>>> sed 's/$$[^\.]*$$.$$[^,]*$$,$$[^\.]*$$.$$[^e]*$$e$$.*$$/\1,\2
>>> \& $\3,\4 \\cdot 10^{\5}$\\\\/'
>>>
>>> omg I feel so h4xx0r figuring that out myself lol
>>> Thx for the help all :)
>>>
>> I am surprised you got it all in 1 regex, I was aiming more for:
>>
>> sed 's/,/ & /;s/\./,/;s/$$.*$$e$$.*$$/\1 \\cdot 10^{\2}/'
>>
>
> whoops, I made a mistake:
>
> sed 's/,/ \& /;s/\./,/g;s/$$.*$$e$$.*$$/\1 \\cdot 10^{\2}\\$\\\\/'
>

some wag once said...

"Some people, when confronted with a problem, think "I know, I’ll use
regular expressions." Now they have two problems."

:)
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8594222068786621, "perplexity": 18783.10805768049}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-41/segments/1412037663612.31/warc/CC-MAIN-20140930004103-00157-ip-10-234-18-248.ec2.internal.warc.gz"}