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)
Hi, I have to change a tab delimited file to a fixed length file. For text fields I need to left justify and NULL fill to the right and for number fields I need to right justify and zero fill to the left. If there are spaces between words in a text field I need to keep them as spaces. I am using... (14 Replies)
If someone out there could help me out with this problem. I would really appreciate it.
I am trying to convert xml into text file(fixed length) using Unix Borne shell scripts.
My xml file:
<root>
<header_rec recordtype="00">
<record_id>00</record_id>
... (0 Replies)
I have below fixed lenth file . I have to convert this to delimitted file.
File1.txtE116005/29/19930E001E000
E12201/23/19940E001E003
E10406/4/19940E001E003
I want to convert this to :
E116,0,05/29/1993,0,E001,E000
E122,0,1/23/1994,0,E001,E003
E104,0,6/4/1994,0,E001,E003
I have a... (7 Replies)
Newbie
Looking for a script to convert my input file to delimited text file. Not familier with AWK or shell programing. Below is sample record in my input file and the expected output format. My OS is HPUX 11.23.
Thanks in advance for your assistance.
tbtbs
input file:... (12 Replies)
Very, very new to unix scripting and have a unique situation. I have a file of records that contain 3 records types:
(H)eader Records
(D)etail Records
(T)railer Records
The Detail records are 82 bytes in length which is perfect. The Header and Trailer records sometimes are 82 bytes in... (3 Replies)
Hi All,
I need to convert a fixed length file to a delimited file with , (comma). But not all columns, some of the columns in the fixed files are used as fillers and I do not need that in the output file.
test_fixed_len.txt
I 0515 MR 394
I 0618 MR & MRS 942
I 0618 MR & MRS... (7 Replies)
Hi Team,
I have an issue to split the file which is having special chracter(German Char) using awk command.
I have a different length records in a file. I am separating the files based on the length using awk command.
The command is working fine if the record is not having any... (7 Replies)
Discussion started by: Anthuvan
7 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)