05-20-2011
It's really the program that is READing your file that interprets the LF or CR. Early when teletypes were system consoles, they needed more control, such as when someone logged in, they had to mask the password, so the system used CR, typed a string, then CR again typed another string, so it ended up a virtual black line. When Dot matrix was used, they knew which characters used each pin and could cover it a a couple of passes.
But it goes back to whose using it, most disk drives contain the number of bytes in the file, for example, you could have an executable with a byte(s) or CR or LF or CRLF. In which case it could be data or an instruction. In this case the OS would read data, length specified in the load module, from the disk, and load it to a specified location or let the OS move it to where it could run, then also in the data is an offset to execute, so the machine knows where to start the program. Writing in Assembly code, you can put data and code anywhere, then specify the starting point.
So in your instance it boils down to 'whose reading it'!
Hope this will help some....
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi,
I have this file which has some octal NULL characters (\000). I need to replace these characters with an ASCII NULL.
I've tried using Perl, the UNIX tr command..
History of this
I received a COBOL generated file, ran the od command to convert to a xxx byte per record file.
Now,... (3 Replies)
Discussion started by: uchachra
3 Replies
2. Shell Programming and Scripting
hi ,
When i ftp a text file from Windows to unix enviornment and open the file in " vi editor" the end line charcrter of the windows file is seen as "cntrl+M" charcter in the Unix enviornment.
Is there any command in unix , so that i dont see this "cntrl+M"
chararcter in the... (9 Replies)
Discussion started by: dharmesht
9 Replies
3. UNIX for Dummies Questions & Answers
How to convert ^M appearing at end of line to unix newline?
As I have tried with ^M in 'tr' it replaced ^ to a newline.
Thanks in advance. (21 Replies)
Discussion started by: videsh77
21 Replies
4. Programming
Helo,
my server side system is running on a redhat linux o.s.
I have c program on the server which export list file into CSV format. now,
I want that my program on server side is able to add support for
CRLF(carriage return Line feed)into csv file format. so how do i write C program whcih... (3 Replies)
Discussion started by: amitpansuria
3 Replies
5. Shell Programming and Scripting
How should I replace End of line Character by ".
i.e in a file -
Name1,NO1
Name2,No2
Name3,No3
....
Should look like --
Name1,NO1"
Name2,No2"
Name3,No3"
.... (2 Replies)
Discussion started by: The Observer
2 Replies
6. Shell Programming and Scripting
I am trying to convert a txt file that includes one long string of data. The lines are separated with hex value 7C (for pipe).
I am trying to process this file using SQR (Peoplesoft) so I thought the easiest thing to do would be to replace the eol char with a CRLF in unix so I can just... (4 Replies)
Discussion started by: sfedak
4 Replies
7. Shell Programming and Scripting
Im trying to brush up with my awk knowledge and update some old scripts to be a little more compact...
What I would like to know how to do is the following:
hostname,10.10.10.1
I have the above csv (with many more fields of course) how can I write a single line to pull field 2 from the... (7 Replies)
Discussion started by: trey85stang
7 Replies
8. Shell Programming and Scripting
I need to append |\r\n (a pipe character and CRLF) at end of each record in Unix to all records where they are not already present.
So first check for the presence of |\r\n and if absent append it else do nothing (3 Replies)
Discussion started by: abhilashnair
3 Replies
9. UNIX for Beginners Questions & Answers
I am trying to add a date variable to the end of each line. This is what I have to start with
cat ${DATAPATH}/Participate_Stream${STREAMDATE}.dryak1.csv | grep ^',' | awk '{print $0}' >> ${DATAPATH}/badparticipant.csv
This is what I tried $DATE is a variable I have defined.
cat... (3 Replies)
Discussion started by: req62861
3 Replies
10. UNIX for Beginners Questions & Answers
My sample file is variable length, with out any field delimiters. It has min of 18 chars length and the 'CRLF' is potentially between 12-14 chars. How do I replace this with a space? I still want to keep end of record, but just want to remove these new lines chars in the middle of the data.
... (7 Replies)
Discussion started by: chandrath
7 Replies
LEARN ABOUT MOJAVE
mime::decoder::nbit5.18
MIME::Decoder::NBit(3) User Contributed Perl Documentation MIME::Decoder::NBit(3)
NAME
MIME::Decoder::NBit - encode/decode a "7bit" or "8bit" stream
SYNOPSIS
A generic decoder object; see MIME::Decoder for usage.
DESCRIPTION
This is a MIME::Decoder subclass for the "7bit" and "8bit" content transfer encodings. These are not "encodings" per se: rather, they are
simply assertions of the content of the message. From RFC-2045 Section 6.2.:
Three transformations are currently defined: identity, the "quoted-
printable" encoding, and the "base64" encoding. The domains are
"binary", "8bit" and "7bit".
The Content-Transfer-Encoding values "7bit", "8bit", and "binary" all
mean that the identity (i.e. NO) encoding transformation has been
performed. As such, they serve simply as indicators of the domain of
the body data, and provide useful information about the sort of
encoding that might be needed for transmission in a given transport
system.
In keeping with this: as of MIME-tools 4.x, this class does no modification of its input when encoding; all it does is attempt to detect
violations of the 7bit/8bit assertion, and issue a warning (one per message) if any are found.
Legal 7bit data
RFC-2045 Section 2.7 defines legal "7bit" data:
"7bit data" refers to data that is all represented as relatively
short lines with 998 octets or less between CRLF line separation
sequences [RFC-821]. No octets with decimal values greater than 127
are allowed and neither are NULs (octets with decimal value 0). CR
(decimal value 13) and LF (decimal value 10) octets only occur as
part of CRLF line separation sequences.
Legal 8bit data
RFC-2045 Section 2.8 defines legal "8bit" data:
"8bit data" refers to data that is all represented as relatively
short lines with 998 octets or less between CRLF line separation
sequences [RFC-821]), but octets with decimal values greater than 127
may be used. As with "7bit data" CR and LF octets only occur as part
of CRLF line separation sequences and no NULs are allowed.
How decoding is done
The decoder does a line-by-line pass-through from input to output, leaving the data unchanged except that an end-of-line sequence of CRLF
is converted to a newline "
". Given the line-oriented nature of 7bit and 8bit, this seems relatively sensible.
How encoding is done
The encoder does a line-by-line pass-through from input to output, and simply attempts to detect violations of the "7bit"/"8bit" domain.
The default action is to warn once per encoding if violations are detected; the warnings may be silenced with the QUIET configuration of
MIME::Tools.
SEE ALSO
MIME::Decoder
AUTHOR
Eryq (eryq@zeegee.com), ZeeGee Software Inc (http://www.zeegee.com).
All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.18.2 2013-11-14 MIME::Decoder::NBit(3)