08-20-2009
That worked perfectly. Even with the records containg garbage characters.
Thank you very much.
methyl
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Is there a command that sets a variable length?
I have a input of a variable length field but my output for that field needs to be set to 32 char.
Is there such a command?
I am on a sun box running ksh
Thanks (2 Replies)
Discussion started by: r1500
2 Replies
2. Shell Programming and Scripting
I am trying to display df -h command out in proper format, how can I display
each field of each record in a fixed length. (2 Replies)
Discussion started by: roopla
2 Replies
3. Shell Programming and Scripting
Hi Unix Champs,
I want to awk on a fixed length file.
Instead if the file was a delimited file, then I could have used -F and then could have easily done manipulation on the fields.
How do i do the same in case of fixed length file?
Thanks in Advance.
Regards. (7 Replies)
Discussion started by: c2b2
7 Replies
4. Shell Programming and Scripting
Hi,
I need some help regarding in writing a Korne shell script, in determining the fixed length records in a data file. We have already utility in place, which does this work. The Code for this is as below. In the below $1 is the parameter passed to the script, which is the data file name.
... (4 Replies)
Discussion started by: nrajesh_2009
4 Replies
5. Shell Programming and Scripting
OK I am somewhat new to UNIX programming please see what you can do to help.
I have a flat file that is a fixed length file containing different records based on the 1st character of each line. The 1st number at the beginning of the line is the record number, in this case it's record #1.
I... (3 Replies)
Discussion started by: ambroze
3 Replies
6. Shell Programming and Scripting
New to awk and need some help. I have a script that I would like to make more compact. I want to read a file and grab every field, from every record, except the last field. The records are variable length and have varying number of fields. A record will have at least two fields, but can have... (9 Replies)
Discussion started by: synergy_texas
9 Replies
7. Shell Programming and Scripting
Need a script that manipulates a fixed length file that will compare 2 fields in that file and if they are equal write that line to a new file.
i.e. If fields 87-93 = fields 119-125, then write the entire line to a new file. Do this for every line in the file. After we get only the fields... (1 Reply)
Discussion started by: Muga801
1 Replies
8. Shell Programming and Scripting
I was trying to use the AIX 6.1 sort command to sort fixed-length data records, sorting by specific columns only. It took some time to figure out how to get it to work, so I wanted to share the solution. The sort man page wasn't much help, because it talks about field delimeters (default space... (1 Reply)
Discussion started by: CheeseHead1
1 Replies
9. Shell Programming and Scripting
Hi,
I am in a situation to print the message on a column, where the each line starting position should be same.
For example code:
HOSTNAME1="1.2.3.4.5.6.7"
TARGET_DIR="/tmp"
echo "HOSTNAME1:" "$HOSTNAME1" | awk -v var="Everyone" '{len=55-length;printf("%s%*s\n",$0,len,var)}'
echo... (4 Replies)
Discussion started by: tprabhaker
4 Replies
10. Shell Programming and Scripting
Hi,
I need to split a fixed length file of 160 characters based on value of a column. Example:
ABC 456780001 DGDG SDFSF
BCD 444440002 SSSS TTTTT
ABC 777750003 HHHH UUUUU
THH 888880001 FFFF LLLLLL
HHH 999990002 GGGG OOOOO
I need to split this file on basis of column from... (7 Replies)
Discussion started by: Neelkanth
7 Replies
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)