Advertisement
Thewest123

sed - ČNB

Apr 27th, 2022
660
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.75 KB | None | 0 0
  1. #!/usr/bin/env -S sed -Ef
  2.  
  3. {
  4.     1,576d
  5.     846,$d
  6. }
  7.  
  8. /<p>Platnost pro/ {
  9.  
  10.     s/.*Platnost pro ([^ ]*\.) ([^ ]*\.) ([^ ]*), .*: ([0-9]{1,}).*/\1\2\3 \#\4/
  11.  
  12. }
  13.  
  14. /<th[^ead]/ {
  15.  
  16.     s/.*>(.*)<\/th>/\1/g
  17.     s/^$//
  18.  
  19. }
  20.  
  21. /<td/ {
  22.  
  23.     s/.*>(.*)<\/td>/\1/g
  24.     s/^$//
  25.  
  26. }
  27.  
  28. {
  29.     s/<\/tr>//g
  30.     s/<tr>//g
  31.     s/<thead>//g
  32.     s/<\/thead>//g
  33.     s/<tbody>//g
  34.     s/<table class="currency-table">//g
  35.     s/\s //g
  36.     /^$/d
  37. }
  38.  
  39. {
  40.     N
  41.     N
  42.     N
  43.     N
  44. }
  45.  
  46. {
  47.     s/<td align="(right|center)">//g
  48.     s/<td>//g
  49.     s/<\/td>//g
  50.     s/<\/th>//g
  51.     s/<th>//g
  52.     s/<th class="(currency-table|currency-name)">//g
  53.     s/<tr>//g
  54.     s/<thead>//g
  55.     s/<table class="currency-table">//g
  56.     s/\s\s+/|/g
  57.     s/(\#[0-9]+)\|/\1/g
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement