Thanks 'durden_tyler' your code worked...but just to mention that it didn't work on Windows...
...
I think its due to the fact that interpreters like 'sed', 'Perl' ignores 'CR' (chariage return) characters on windoze..........
Don't know about "sed" on Windows, but that would be highly unusual for Perl on Windows:
The perl interpreter used in the example above is from the ActiveState Perl installed using MSI.
"vis" is just a small C program that makes non-printable characters visible in octal code.
I must remove hex characters 0A and 0D from several fields within an MS Access Table. Since I don't think it can be done in Access, I am trying here.
I am exporting a Table from Access (must be fixed length fields, I think, for my idea to work here) into a text format.
I then want to run a... (2 Replies)
Hi, I have a script for replacing bad characters in filenames
for f in *; do mv $f `echo $f | tr '+' '_'`
done;
this replaces + for _
But I need to replace all bad characters ? / % + to _
Pls how can i do this in one script ? (3 Replies)
:b:Guys,
Can some body throw some light on this please.....
sprintf(req_line1, "%c%s%c", '\x0b',"TESTING1",'\x0d');
sprintf(req_line2, "%s%c", "TESTING2", '\x0d');
sprintf(req_line3, "%s%c", "Testing3", '\x0d');
sprintf(req_line4, "%s%c%c%c", "Testing4", '\x0d', '\x1c', '\x0d');
... (6 Replies)
Hi,
I am a bit stuck with displaying characters. I am having values like below in the proper displayable characters. which I would want to print the actual value on the right hand side. I dont want to create an array because I would have to create 255 different values. isnt there another way of... (17 Replies)
Hello,
Yesterday I was looking for a way to grep for a tab in the shell, and found this solution in several places:
grep $'a' # Grep for the letter 'a' between two tabs
I'm fine with most of this, but I don't understand what the $ (dollar sign) before the first quote does. It doesn't work... (7 Replies)
I have the following file consisting of dates and sample measurements:
05��Oct��2010 1.31��
06��Oct��2010 1.32��
07��Oct��2010 1.31��
The hex characters are \xc2\xa0 in sequence.
I have tried to remove the characters as follows:
sed -i '' -e 's/\xc2\xa0//g' file.dat
and as follows... (6 Replies)
sed -e "s// /g" old.txt > new.txt
While I do know some control characters need to be escaped, can normal characters also be escaped and still work the same way? Basically I do not know all control characters that have a special meaning, for example, ?, ., % have a meaning and have to be escaped... (11 Replies)
Hi guys,
First off, i'm a complete noob to UNIX and LINUX so apologies if I don't understand the basics!
I have a file which contains a hex value of '0D' at the end of each line when I look at it in a hex viewer.
I need to change it so it contains a hex value of '0D0A0A'
I thought... (10 Replies)
Hi Forum.
I'm running the following awk command to extract the suffix value (pos 38) from the "AM00" record and append to the end of the "AM01" record.
awk 'substr($0,13,4)=="AM00" {SUFFIX = substr($0,38,2)} substr($0,13,4)=="AM01" {$0 = $0 SUFFIX} 1' before.txt > after.txt
Before.txt:... (2 Replies)
Discussion started by: pchang
2 Replies
LEARN ABOUT HPUX
vis
vis(1) General Commands Manual vis(1)NAME
vis, inv - make unprintable and non-ASCII characters in a file visible or invisible
SYNOPSIS
file ...
file ...
DESCRIPTION
reads characters from each file in sequence and writes them to the standard output, converting those that are not printable or not ASCII
into a visible form. inv performs the inverse function, reading printable characters from each file, returning them to non-printable or
non-ASCII form, if appropriate, then writing them to standard output;
Non-printable ASCII characters are represented using C-like escape conventions:
backslash
backspace
escape
form-feed
new-line
carriage return
space
horizontal tab
vertical tab
the character whose
ASCII code is the 3-digit octal number n.
the character whose
ASCII code is the 2-digit hexadecimal number n.
Non-ASCII single- or multi-byte characters are examined one byte at a time. For each byte, if it can be displayed as an ASCII character,
it is treated as if it is an ASCII character; Otherwise, it is represented in the following conventions:
the 8-bit character whose
code value is the 3-digit octal number n.
the 8-bit character whose
code value is the 2-digit hexadecimal number n.
Space, horizontal-tab, and new-line characters can be treated as printable (and therefore passed unaltered to the output) or non-printable
depending on the options selected. Backslash, although printable, is expanded by vis, to a pair of backslashes so that when they are
passed back through inv, they convert back to a single backslash.
If no input file is given, or if the argument is encountered, and inv read from the standard input.
Options
and recognize the following options:
Treat new-line, space, and horizontal tab as non-printable characters.
expands them visibly as and rather than passing them directly to the output. discards these characters, expecting only the
printable expansions. New-line characters are inserted by every 16 bytes so that the output will be in a form that is
usable by most editors.
Make and silent about non-existent files, identical input and output, and write errors. Normally, no input file can be the same
as the output file unless it is a special file.
Treat horizontal-tab and space characters as non-printable
in the same manner that treats them.
Cause output to be unbuffered (byte-by-byte);
normally, output is buffered.
Cause output to be in hexadecimal form rather than the default octal form. Either form is accepted to as input.
EXTERNAL INFLUENCES
Environment Variables
determines the language in which messages are displayed.
International Code Set Support
Single- and multi-byte character code sets are supported.
WARNINGS
Redirecting output to an input file destroys the original data. Therefore, command forms such as
should be avoided unless the source file can be safely discarded.
AUTHOR
was developed by HP.
SEE ALSO cat(1), echo(1), od(1).
vis(1)