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 OPENDARWIN
wc
WC(1) BSD General Commands Manual WC(1)NAME
wc -- word, line, character, and byte count
SYNOPSIS
wc [-clmw] [file ...]
DESCRIPTION
The wc utility displays the number of lines, words, and bytes contained in each input file (or standard input, by default) to the standard
output. A line is defined as a string of characters delimited by a <newline> character, and a word is defined as a string of characters
delimited by white space characters. White space characters are the set of characters for which the iswspace(3) function returns true. If
more than one input file is specified, a line of cumulative counts for all the files is displayed on a separate line after the output for the
last file.
The following options are available:
-c The number of bytes in each input file is written to the standard output.
-l The number of lines in each input file is written to the standard output.
-m The number of characters in each input file is written to the standard output. If the current locale does not support multibyte
characters, this is equivalent to the -c option.
-w The number of words in each input file is written to the standard output.
When an option is specified, wc only reports the information requested by that option. The default action is equivalent to specifying the
-c, -l and -w options.
If no files are specified, the standard input is used and no file name is displayed.
ENVIRONMENT
The LANG, LC_ALL and LC_CTYPE environment variables affect the execution of wc as described in environ(7).
EXAMPLES
Count the number of characters, words and lines in each of the files report1 and report2 as well as the totals for both:
wc -mlw report1 report2
DIAGNOSTICS
The wc utility exits 0 on success, and >0 if an error occurs.
SEE ALSO iswspace(3)COMPATIBILITY
Historically, the wc utility was documented to define a word as a ``maximal string of characters delimited by <space>, <tab> or <newline>
characters''. The implementation, however, didn't handle non-printing characters correctly so that `` ^D^E '' counted as 6 spaces, while
``foo^D^Ebar'' counted as 8 characters. 4BSD systems after 4.3BSD modified the implementation to be consistent with the documentation. This
implementation defines a ``word'' in terms of the iswspace(3) function, as required by IEEE Std 1003.2 (``POSIX.2'').
STANDARDS
The wc utility conforms to IEEE Std 1003.1-2001 (``POSIX.1'').
HISTORY
A wc command appeared in Version 1 AT&T UNIX.
BSD June 13, 2002 BSD