Created
          December 2, 2023 20:00 
        
      - 
      
- 
        Save MikaelFangel/05dd1f1cbc2a86fd3311b6b72f7e3017 to your computer and use it in GitHub Desktop. 
    Advent of Code 2023 - Day 1 Part 2 - Cleaner script to make the file easier to parse 
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/env bash | |
| file=./input.txt | |
| sed -i s/eighthree/83/g $file | |
| sed -i s/eightwo/82/g $file | |
| sed -i s/sevenine/79/g $file | |
| sed -i s/fiveight/58/g $file | |
| sed -i s/threeight/38/g $file | |
| sed -i s/twone/21/g $file | |
| sed -i s/oneight/18/g $file | |
| sed -i -e :a -e '/^\n*$/{$d;N;ba' -e '}' $file | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment