02-09-2009
Please post an example of input and expected output. Please make the number base and character set clear, or state that it is raw data. We normally assume ASCII characters, but your sample characters are mostly outside the normal printable range.
Your example looks like hexadecimal rather than binary which may be why nobody has responded.
Please also post the version of Unix/Linux. There are core tools in most unixes to handle conversion.
If you are trying to fix a non-text data file this is not a job for shell scripting.
9 More Discussions You Might Find Interesting
1. What is on Your Mind?
Okay, I don't know how this is funny, but it is. I found this while searching for Linux (please don't ask). :o (0 Replies)
Discussion started by: gnerd
0 Replies
2. Solaris
:) Hi,
Can any one help me to find available escape sequences in UNIX shell programming? ( Like \n, \c etc,. in C or C++)
Iam generating one report using one of the script, in that it is very much essential.
Regards,
LOVE (6 Replies)
Discussion started by: Love
6 Replies
3. Programming
hi
how to deal with hardware in c or c++?
i need to learn how open CD and close any hard >>> and control hardware
:) (2 Replies)
Discussion started by: hgphsf
2 Replies
4. Programming
Hi,
i have read trigraph sequence in
The C99 Draft (N869, 18 January, 1999)
printf("Eh???/n");
will produce
printf("Eh?\n");
what does that mean?
i tried that but i am getting the same output i.e
Eh???/n.
what actually these tri graph characters are?
any idea why ,when and... (1 Reply)
Discussion started by: MrUser
1 Replies
5. Shell Programming and Scripting
My file looks like this:
But I would like to 'trim' all sequences to the same lenght 32 characters, keeping intact all the identifier (>GHXCZCC01AJ8CJ)
Would it be possible to use awk to perform this task? (2 Replies)
Discussion started by: Xterra
2 Replies
6. Shell Programming and Scripting
Hello *nix specialists,
Im working for a non profit organisation in Germany to transport DSL over WLAN to people in areas without no DSL. We are using Linksys WRT 54 router with DD-WRT firmware There are at the moment over 180 router running but we have to change some settings next time. So my... (7 Replies)
Discussion started by: digidax
7 Replies
7. Shell Programming and Scripting
Hello to all,
I would like to search sequences of bytes inside big binary file.
The bin file contains blocks of information, each block begins is estructured as follow:
1- Each block begins with the hex 32 (1 byte) and ends with FF. After the FF of the last block, it follows 33.
2- Next... (59 Replies)
Discussion started by: Ophiuchus
59 Replies
8. Shell Programming and Scripting
Hi Gurus,
Escape sequences \n, \t, \b, \t, \033(1m are not working.
I just practiced these escape sequences. It worked first. Later its not working.
Also the command - echo inside the script editor shows as shaded by a color. Before that echo inside the script editor wont show like this.... (4 Replies)
Discussion started by: GaneshAnanth
4 Replies
9. Shell Programming and Scripting
Hi,
Please would anybody help find the missing sequences in the filename of the files?
I have for example these files:
OOOAAAALOGS400001.txt
OOOAAAALOGS400002.txt
OOOAAAALOGS400003.txt
OOOBBBBLOGS40001.txt
OOOBBBBLOGS400002.txt
OOOBBBBLOGS400003.txt
OOOCCCCLOGS400001.txt... (13 Replies)
Discussion started by: arrals_vl
13 Replies
LEARN ABOUT PHP
ctype_print
CTYPE_PRINT(3) 1 CTYPE_PRINT(3)
ctype_print - Check for printable character(s)
SYNOPSIS
bool ctype_print (string $text)
DESCRIPTION
Checks if all of the characters in the provided string, $text, are printable.
PARAMETERS
o $text
- The tested string.
RETURN VALUES
Returns TRUE if every character in $text will actually create output (including blanks). Returns FALSE if $text contains control charac-
ters or characters that do not have any output or control function at all.
EXAMPLES
Example #1
A ctype_print(3) example
<?php
$strings = array('string1' => "asdf
", 'string2' => 'arf12', 'string3' => 'LKA#@%.54');
foreach ($strings as $name => $testcase) {
if (ctype_print($testcase)) {
echo "The string '$name' consists of all printable characters.
";
} else {
echo "The string '$name' does not consist of all printable characters.
";
}
}
?>
The above example will output:
The string 'string1' does not consist of all printable characters.
The string 'string2' consists of all printable characters.
The string 'string3' consists of all printable characters.
NOTES
Note
If an integer between -128 and 255 inclusive is provided, it is interpreted as the ASCII value of a single character (negative val-
ues have 256 added in order to allow characters in the Extended ASCII range). Any other integer is interpreted as a string contain-
ing the decimal digits of the integer.
SEE ALSO
ctype_cntrl(3), ctype_graph(3), ctype_punct(3).
PHP Documentation Group CTYPE_PRINT(3)