1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
#Leer el contenido de un fichero en ASCII Write-Host "Contenido del fichero en ASCII" gc .\eje.txt #Leer el contenido del fichero en decimal Write-Host "Contenido del fichero en decimal" [System.IO.File]::ReadAllBytes('.\eje.txt') #Leer el contenido del fichero en decimal y representar cada símbolo decimal en decimal Write-Host "Cada símbolo que hay en el fichero se representa en decimal" [System.Text.Encoding]::ASCII.getBytes([System.IO.File]::ReadAllBytes('.\eje.txt')) #Cada símbolo se representa en decimal [System.IO.File]::ReadAllBytes('.\eje.txt') | %{ Write-Host "Símbolo:"$_ "se representa en decimal:" ([System.Text.Encoding]::ASCII.getBytes($_)) } |