online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
# Online Bash Shell. # Code, Compile, Run and Debug Bash script online. # Write your code in this editor and press "Run" button to execute it. cat > /dev/shm/ex01.html <<++++++++++ <html><title>Some report 01 2021 4</title><body background=White;> <table border=1 width=90% align=center bgcolor=#f7f7e7> <tr><td width=80%> (02) some text </td><td> 541 </td></tr> <tr><td> (03) some text </td><td> 541 </td></tr> <tr><td> (04) some text </td><td> 5039,76 </td></tr> <tr><td> (05) some text </td><td> 4925 </td></tr> <tr><td> (06) some text </td><td> 5039,76 </td></tr> <tr><td> (09) some text </td><td> 320 </td></tr> <tr><td> (10) some text </td><td> 385 </td></tr> <tr><td> (11) some text </td><td> 82 </td></tr> </table> </body><html> ++++++++++ cat > /dev/shm/ex02.html <<++++++++++ <html><title>Some report 02 2021 4</title><body background=White;> <table border=1 width=90% align=center bgcolor=#f7f7e7> <tr><td width=80%> (02) some text </td><td> 236 </td></tr> <tr><td> (03) some text </td><td> 236 </td></tr> <tr><td> (04) some text </td><td> 5039,76 </td></tr> <tr><td> (05) some text </td><td> 4925 </td></tr> <tr><td> (06) some text </td><td> 5039,76 </td></tr> <tr><td> (09) some text </td><td> 320 </td></tr> <tr><td> (10) some text </td><td> 385 </td></tr> <tr><td> (11) some text </td><td> 82 </td></tr> </table> </body><html> ++++++++++ ## Solution #1 - with pipe echo Convert /dev/shm/ex01.html to CSV sed -e '/\(html\|title\|body\|table\)/d' -e 's/ \{2,\}//g' /dev/shm/ex01.html | \ sed ':a;N;$!ba;s#\s*</td>\s*</tr>\s*<tr>\s*<td>\s*#\n#g' | \ sed ':b;N;$!bb;s#\s*</td>\s*<td>\s*#;#g' | \ sed '/\(tr>\|<td\|td>\)/d' echo ## Solution #2 - all in one sed echo Convert /dev/shm/ex02.html to CSV sed '/title/d :a;N;$!ba s/ \{2,\}//g s#\s*</td>\s*</tr>\s*<tr>\s*<td>\s*#\n#g s#\s*</td>\s*<td>\s*#;#g s/<[^>]\+>//g s/\n\{2,\}//g' /dev/shm/ex02.html echo ## Solution #3 - all in one sed echo Convert /dev/shm/ex02.html to CSV sed ':a;N;$!ba s/<html.\+<table[^>]\+>//g s#\s*</td>\s*</tr>\s*<tr>\s*<td>\s*#\n#g s#\s*</td>\s*<td>\s*#;#g s/<[^>]\+>//g;s/\s\{2,\}//g' /dev/shm/ex02.html echo echo Summing the values of line with string "(02)" sed ':b;N;$!bb;s#\s*</td>\s*<td>\s*#;#g' /dev/shm/*.html | \ awk -F ';' '/\(02\)/ {sum += $2} END {print sum}'

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue