All,
I am new to unix and i have the following requirement.
I have file(s) landing into input directory with timestamp, first i want to copy all these files into seperate directory then i want to rename these files without timestamp and also remove header,trailer from that file..
Could... (35 Replies)
Hi All,
I am karthik. I am new to this forum. I have one requirement.
I have a file with header and footer.
Header may be like
HDR0001
or
FILE20090110
(Assume it is unknown so far, but i am sure there is a header in the file)
likewise file has the trailer too.
I just... (7 Replies)
Hi all,
I have a requirement to create a Header &Trailer for a file which is having 20 millions of records.
If I use the following method, i think it will take more time.
cat "Header"> file1.txt
cat Data_File>>file1.txt
cat "Trailer">>file1.txt
since second CAT command has to read all... (4 Replies)
How can we a shell script and pass date parameters .I have 3 files comming from Datastage with |" delimited
I need append 3 files as above: File1:
P0000|"47416954|"AU|"000|"INS|"0000|"|"20060601|"99991231|"|"|"|"|"01
File 2:... (2 Replies)
for example, i have a file with below content:
123413
866688
816866
818818
i want the output as:
This is header
123413
866688
816866
818818
This is trailer
i am able to achieve it using a bash script. (2 Replies)
Hi All,
I am trying write a simple command using AWK and SED to this but without any success.
Here is what I am using:
head -1 test1.txt>test2.txt|sed '1d;$d' test1.txt|awk '{print substr($0,0,(length($0)-2))}' >>test2.txt|tail -1 test1.txt>>test2.txt
Input:
Header
1234567
abcdefgh... (2 Replies)
Hi,
I need a script that validates a file header/detail/trailer. File layout is:
Header - Rec_Type|File_name|File_Date
Detail - Rec_Type|field1|field2|field3...
Trailder - Rec_Type|File_name|File_Date|Record_count
Sample Data:
HDR|customer_data.dat|20120709... (7 Replies)
I need to split the file based on pattern from position 34-37 while retaining the header and trailer records in each individual split file
Also is it possible to output the TOM and PAT records in the same output file ?
I need the output file names same as xyz_pattern_Datetimestamp.txt
... (23 Replies)
I have a EBCDIC multi layout file which has a header record which is 21 bytes, The Detail records are 2427 bytes long and the trailer record is 9 bytes long.
Is there a command to remove the header as well as trailer record and read only the detail records while at the same time not altering... (1 Reply)
Discussion started by: abhilashnair
1 Replies
LEARN ABOUT NETBSD
uuencode
UUENCODE(5) BSD File Formats Manual UUENCODE(5)NAME
uuencode -- format of an encoded uuencode file
DESCRIPTION
Files output by uuencode(1) consist of a header line, followed by a number of body lines, and a trailer line. The uudecode(1) command will
ignore any lines preceding the header or following the trailer. Lines preceding a header must not, of course, look like a header.
The header line starts with the word ``begin'', a space, a file mode (in octal), a space, and finally a string which names the file being
encoded.
The central engine of uuencode(1) is a six-bit encoding function which outputs an ASCII character. The six bits to be encoded are treated as
a small integer and added with the ASCII value for the space character (octal 40). The result is a printable ASCII character. In the case
where all six bits to be encoded are zero, the ASCII backquote character ` (octal 140) is emitted instead of what would normally be a space.
The body of an encoded file consists of one or more lines, each of which may be a maximum of 86 characters long (including the trailing new-
line). Each line represents an encoded chunk of data from the input file and begins with a byte count, followed by encoded bytes, followed
by a newline.
The byte count is a six-bit integer encoded with the above function, representing the number of bytes encoded in the rest of the line. The
method used to encode the data expands its size by 133% (described below). Therefore it is important to note that the byte count describes
the size of the chunk of data before it is encoded, not afterwards. The six bit size of this number effectively limits the number of bytes
that can be encoded in each line to a maximum of 63. While uuencode(1) will not encode more than 45 bytes per line, uudecode(1) will toler-
ate the maximum line size.
The remaining characters in the line represent the data of the input file encoded as follows. Input data are broken into groups of three
eight-bit bytes, which are then interpreted together as a 24-bit block. The first bit of the block is the highest order bit of the first
character, and the last is the lowest order bit of the third character. This block is then broken into four six-bit integers which are
encoded one by one starting from the first bit of the block. The result is a four character ASCII string for every three bytes of input
data.
Encoded lines of data continue in this manner until the input file is exhausted. The end of the body is signaled by an encoded line with a
byte count of zero (the ASCII backquote character `).
Obviously, not every input file will be a multiple of three bytes in size. In these cases, uuencode(1) will pad the remaining one or two
bytes of data with garbage bytes until a three byte group is created. The byte count in a line containing garbage padding will reflect the
actual number of bytes encoded, making it possible to convey how many bytes are garbage.
The trailer line consists of ``end'' on a line by itself.
SEE ALSO mail(1), uucp(1), uudecode(1), uuencode(1), ascii(7)HISTORY
The uuencode file format appeared in 4.0BSD.
BUGS
The interpretation of the uuencode format relies on properties of the ASCII character set and may not work correctly on non-ASCII systems.
BSD April 9, 1997 BSD