I don't make much use of PowerShell either, and love Windows Subsystem for 
Linux.  But PS, verbose or not, does seem quite powerful.

________________________________
From: IBM Mainframe Discussion List <[email protected]> on behalf of 
David Crayford <[email protected]>
Sent: Tuesday, December 29, 2020 11:15 AM
To: [email protected] <[email protected]>
Subject: Re: EBCDIC-ASCII converter and other tools

I'm using PowerShell 7.2. I don't use PowerShell all that often but when
I do I'm blown away by it's power and turned off by it's verbosity. I
tend to stick to bash CLI scripts
and Python these days and my beloved Lua for embedded scripting. Ever
since Windows got a Linux subsystem I spend all my time in a bash shell :)

On 30/12/2020 2:09 am, Frank Swarbrick wrote:
> It doesn't look like Windows 10 included PowerShell supports EBCDIC, but the 
> open source version, PowerShell 7.1 does.
>
> PS C:\Users\fswar> Format-Hex 1047.txt
>
>     Label: C:\Users\fswar\1047.txt
>
>            Offset Bytes                                           Ascii
>                   00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
>            ------ ----------------------------------------------- -----
> 0000000000000000 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 40                ðñòóôõö÷øù@
>
> PS C:\Users\fswar> Get-Content 1047.txt -encoding 1047 | Out-File out.txt 
> -encoding ascii -nonewline
> PS C:\Users\fswar> Format-Hex out.txt
>
>     Label: C:\Users\fswar\out.txt
>
>            Offset Bytes                                           Ascii
>                   00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
>            ------ ----------------------------------------------- -----
> 0000000000000000 30 31 32 33 34 35 36 37 38 39 20                0123456789
>
>
>
> ________________________________
> From: IBM Mainframe Discussion List <[email protected]> on behalf of 
> David Crayford <[email protected]>
> Sent: Tuesday, December 29, 2020 10:42 AM
> To: [email protected] <[email protected]>
> Subject: Re: EBCDIC-ASCII converter and other tools
>
> On 30/12/2020 1:12 am, R.S. wrote:
>> This is even simpler tool, maybe it address rare need - just to
>> truncate first nnn bytes from beginning of file
>> Possible usage:
>> truncfile -header -12384 ifile ofile
>> truncates/deletes header, which is 12384 bytes long, the output is
>> written to ofile. Ofile is shorter than ifile, the difference is 12384
>> bytes. No CR/LF issues, just byte after byte.
>
> On Windows install you can WSL and use Linux tools. Or use Powershell
> and do something similar. I don't use Powershell that often and have to
> study to find a bash analog but it's simple using Linux.
>
> tail -c +12385 ifile | iconv -f ibm-1047 -t utf-8 >> ofile
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to