WIDTH(1) General Commands Manual WIDTH(1)NAME
width - force all the lines of a file to a given width
width [-n [ infile [outfile]
OPTIONS -n Outline line size
width -60 x y # Copy x to y, force lines to 60 cols
width x # Copy default (80) column lines to stdout
The input file is copied to the output file. All lines are forced to a given size (default: 80 columns) by padding with spaces or truncat-
ing. Tabs are expanded to spaces.
SEE ALSO fold(1).
Check Out this Related Man Page
FOLD(1) User Commands FOLD(1)NAME
fold - wrap each input line to fit in specified width
fold [OPTION]... [FILE]...
Wrap input lines in each FILE (standard input by default), writing to standard output.
Mandatory arguments to long options are mandatory for short options too.
count bytes rather than columns
count characters rather than columns
break at spaces
use WIDTH columns instead of 80
--help display this help and exit
output version information and exit
GNU coreutils online help: <http://www.gnu.org/software/coreutils/> Report fold translation bugs to <http://translationproject.org/team/>
Written by David MacKenzie.
Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
The full documentation for fold is maintained as a Texinfo manual. If the info and fold programs are properly installed at your site, the
info coreutils 'fold invocation'
should give you access to the complete manual.
GNU coreutils 8.22 June 2014 FOLD(1)
I would like to extract records from a fixed width text file that have unique field elements.
Data is structured like this:
John A Smith NY
Mary C Jones WA
Adam J Clark PA
Mary Jones WA
Fieldname / start-end position
Firstname 1-10... (8 Replies)
Col1 Col2 Col3 Col4
12 Completed 08 0830
12 In Progress 09 0829
11 For F U 07 0828
Considering the file above, how could i replace the third column the most efficient way? The actual file size is almost 1G. I am... (10 Replies)
I am trying to remove a line feed (\n) within a fixed width record. I tried the tr -d ‘\n' command, but it also removes the record delimiter. Is there a way to remove the line feed without removing the record delimiter? (10 Replies)
I have a fixed width file in which the records appear like this
11111 <fixed spaces such as 6> description for 11111 <fixed spaces such as 6> some more field to the record of 11111
22222 <fixed spaces such as 6> description for 22222 <fixed spaces such as 6> some more field to the... (8 Replies)
I was wondering someone might be able to push me in the right direction, I am writing a script to modify fixed-width spool files, As you can see below the original spool file broke a single line into two for printability sake.
I have had been able do the joins using sed, the thing I am... (10 Replies)
I have a fixed width text file without any header row. One of the columns contains a date in YYYYMMDD format.
If the original file contains 3 dates, I want my shell script to split the file into 3 small files with data for each date.
I am a newbie and need help doing this. (14 Replies)
I am checking the treads to get the answer but i am not able to get the answer for my question.
I have two files. First file is a pattern file and the second file is the file i want to search in it. Output will be the lines from file2.
P2797f12af 44751228... (10 Replies)
Have been trying to develop a script that reads a string from an input file then looks up that string in a reference file to get a number, then inset that number back into the original file at a certain point (_____):
HARRY JON _____ AA M N
PETER PIE ... (8 Replies)
I am trying to selectively display several columns from a db2 query, which gives me a fixed-width output (partial output listed here):
--------- -------------------------- ------------ ------
000 0000000000198012 702 29
000 0000000000198013 ... (9 Replies)
I would like to use printf (or something else?) to create a line of text that has varying column widths. This will be used to create a fixed width file (with varying column widths). For example, consider variables $1 $2 $3 are equal to a, b, c respectively and they should be printed in column... (10 Replies)
I have a fixed with file with header & trailer length having the same length of the detail record file.
The details record length of this file is 24, for Header and Trailer the records will be padded with spaces to match the record length of the file
Currently I am adding 3 spaces in header... (14 Replies)
I am facing a typical scenario for AWK command .
In HP- UNIX is behave as expected but in red hat linux same awk code is not give the same result.
The below code is for convert the fixed width file to pipe delimiter file in HP-unix server.
NR!=1... (11 Replies)
I need to join fixed width files on a column which is position 1 to 3 and need to have all the records from file1
I tried but not getting the expected... (12 Replies)