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)
Hi,
I want to add the below Header to all the files in sequence File1,File2,File3...etc
"ABC,<number of chracter in the file>"
e,g - If File1 is as below
pqrstuvdt
abcdefgh
then I want to add the above header into it ,So that File1 becomes as below
ABC,17
pqrstuvdt
abcdefgh
... (9 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)
Is there any command to eliminate Header and footer from EBCDIC file (4 Replies)
Discussion started by: abhilashnair
4 Replies
LEARN ABOUT PLAN9
dd
DD(1) General Commands Manual DD(1)NAME
dd - convert and copy a file
SYNOPSIS
dd [ option value ] ...
DESCRIPTION
Dd copies the specified input file to the specified output with possible conversions. The standard input and output are used by default.
The input and output block size may be specified to take advantage of raw physical I/O. The options are
-if f Open file f for input.
-of f Open file f for output.
-ibs n Set input block size to n bytes (default 512).
-obs n Set output block size (default 512).
-bs n Set both input and output block size, superseding ibs and obs. If no conversion is specified, preserve the input block size
instead of packing short blocks into the output buffer. This is particularly efficient since no in-core copy need be done.
-cbs n Set conversion buffer size.
-skip n Skip n input records before copying.
-iseek n
Seek n records forward on input file before copying.
-files n
Catenate n input files (useful only for magnetic tape or similar input device).
-oseek n
Seek n records from beginning of output file before copying.
-count n
Copy only n input records.
-conv ascii Convert EBCDIC to ASCII.
ebcdic Convert ASCII to EBCDIC.
ibm Like ebcdic but with a slightly different character map.
block Convert variable length ASCII records to fixed length.
unblock Convert fixed length ASCII records to variable length.
lcase Map alphabetics to lower case.
ucase Map alphabetics to upper case.
swab Swap every pair of bytes.
noerror Do not stop processing on an error.
sync Pad every input record to ibs bytes.
Where sizes are specified, a number of bytes is expected. A number may end with or to specify multiplication by 1024 or 512 respectively;
a pair of numbers may be separated by to indicate a product. Multiple conversions may be specified in the style:
is used only if or conversion is specified. In the first two cases, n characters are copied into the conversion buffer, any specified
character mapping is done, trailing blanks are trimmed and new-line is added before sending the line to the output. In the latter three
cases, characters are read into the conversion buffer and blanks are added to make up an output record of size n. If is unspecified or
zero, the and options convert the character set without changing the block structure of the input file; the and options become a simple
file copy.
SOURCE
/sys/src/cmd/dd.c
SEE ALSO cp(1)DIAGNOSTICS
Dd reports the number of full + partial input and output blocks handled.
DD(1)