03-31-2008
I'm not sure where you are going with this... What will it accomplish to convert a file containing legitimate 8-bit characters into pure 7-bit representations?? Is this what you mean by ASCII (really "text"), the first 128 characters of the 256 character UTF-8 set character set???
To do the above requires that 8-bit characters be represented as 2 7-bit characters. One very early way of doing this (for file attachments when there was no other way to "attach" binary files to email) was/is called uuencode (and uudecode to change it back to original form). Your unix system will have some man pages on this program. But again I'm not sure what you are really talking about. If this was a regular TEXT file transmitted in BINARY mode by mistake then the only thing you might have to do is translate line endings -- CR/LF [windows] to LF [unix] for example. If that is what is going on you could use a simple sed script to strip CR (ascii character 13, 0d in hex)...
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
after converting my ebcidic file to ascii i get the following output
2097152+0 records in
1797345+1 records out
Why is there a difference in number of records.
Is the converson chopping off any records.
All i am doing is just a conversion using the following script
dd if=xaa cbs=152 ... (0 Replies)
Discussion started by: rintingtong
0 Replies
2. Shell Programming and Scripting
Hello,
I need a program for ascii to ebsdic conversion. If anybody can help, it'll be greatly appreciated.
Thanks. (1 Reply)
Discussion started by: er_ashu
1 Replies
3. Shell Programming and Scripting
I have a file say "codefile" here ,contains data like this
Hi! How are you?
I need to covert this data into stram of equivalant ASCII values
I wrote follwoing script.
#!/bin/bash
while read -n1 char
do
printf "%d" \'$char
done < codefile
this gives me output
... (4 Replies)
Discussion started by: sunilmenhdiratt
4 Replies
4. Shell Programming and Scripting
Hi,
Can anyone please help me ascci to decimal conversion in bash
I have a file which contains stream of numbers like this,these are ascci values
729711810132973278105991013268971213233
I want to covert it to its actual value like upper code's decimal is
"Have a Nice Day!"
... (15 Replies)
Discussion started by: sunilmenhdiratt
15 Replies
5. UNIX for Dummies Questions & Answers
when i try to convert a mainframe EBCDIC file to ASCII ,i dont see correct file this is the source file
... (3 Replies)
Discussion started by: venkatvelpula
3 Replies
6. Shell Programming and Scripting
Hi,
I have got a library file, created by compiling C code. The file information with "file" command, gives it a "application/x-archive" type file. I want to extract the release string of my software from this file, so that i can know which version of C files were used to create the lib.
Can... (3 Replies)
Discussion started by: atulmt
3 Replies
7. Shell Programming and Scripting
I Am trying to change the file encoding from ASCII to UTF-8 using below command
iconv -f ASCII -t UTF-8 <input_file> > <output_file>
But the output_file is not actually in UTF-8 format. If I use the file command to check the file encoding it still says ASCII.
While converting am not... (5 Replies)
Discussion started by: Sriranga
5 Replies
8. Shell Programming and Scripting
Hi All ,
I have a mainframe file which contains the data in EBCDIC format.I have downloaded this file from mainframe to windows in binary format(unreadable raw data).Now I want convert this file to ASCII format(readable format data) through Unix command.I have tried iconv but that is not working... (2 Replies)
Discussion started by: STCET22
2 Replies
9. UNIX for Advanced & Expert Users
Hi,
I have a input file which is EBCIDIC and it has packed decimals.
Can anyone help me to convert EBCIDIC file to ASCII(Need to convert even Packed decimal values also to normal format).
Thanks
swapna (12 Replies)
Discussion started by: swapna_1990
12 Replies
10. UNIX for Advanced & Expert Users
Hi,
We have a mainframe file which is in EBCDIC format.We dont have direct access to mainframe ,client has provided us the mainframe file.The mainframe file is containing pact data(COMP1 ,COMP2 etc) which are unreadble.Can anyone suggest me how to convert this kind of ebcdic file to ascii... (11 Replies)
Discussion started by: swapna_1990
11 Replies
LEARN ABOUT REDHAT
uuencode
uuencode(n) encode/decoding a binary file uuencode(n)
NAME
uuencode - encode/decoding a binary file
SYNOPSIS
package require Tcl 8
package require uuencode ?1.0.1?
::uuencode::encode string
::uuencode::decode string
::uuencode::uuencode ?-name string? ?-mode octal? (-file filename | ?--? string)
::uuencode::uudecode (-file filename | ?--? string)
DESCRIPTION
This package provides a Tcl-only implementation of the uuencode(1) and uudecode(1) commands. This encoding packs binary data into printable
ASCII characters.
::uuencode::encode string
returns the uuencoded data. This will encode all the data passed in even if this is longer than the uuencode maximum line length. If
the number of input bytes is not a multiple of 3 then additional 0 bytes are added to pad the string.
::uuencode::decode string
Decodes the given encoded data. This will return any padding characters as well and it is the callers responsibility to deal with
handling the actual length of the encoded data. (see uuencode).
::uuencode::uuencode ?-name string? ?-mode octal? (-file filename | ?--? string)
::uuencode::uudecode (-file filename | ?--? string)
UUDecode a file or block of data. A file may contain more than one embedded file so the result is a list where each element is a
three element list of filename, mode value and data.
OPTIONS
-filename name
Cause the uuencode or uudecode commands to read their data from the named file rather that taking a string parameter.
-name string
The uuencoded data header line contains the suggested file name to be used when unpacking the data. Use this option to change this
from the default of "data.dat".
-mode octal
The uuencoded data header line contains a suggested permissions bit pattern expressed as an octal string. To change the default of
0644 you can set this option. For instance, 0755 would be suitable for an executable. See chmod(1).
EXAMPLES
% set d [uuencode::encode "Hello World!"]
2&5L;&@5V]R;&0A
% uuencode::uudecode $d
Hello World!
% set d [uuencode::uuencode -name hello.txt "Hello World"]
begin 644 hello.txt
+2&5L;&@5V]R;&0`
`
end
% uuencode::uudecode $d
{hello.txt 644 {Hello World}}
KEYWORDS
encoding, uuencode
base64 1.0.1 uuencode(n)