Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Delete header row and reformat from tab delimited to fixed width Post 302536650 by chumsky on Wednesday 6th of July 2011 03:22:27 AM
Old 07-06-2011
yes, something like this, but columns 7, 8 & 9 are misaligned
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting a Delimited File to Fixed width file

Hi, I have a delimited file generated by a database and i need to convert it to fixed width file using the field length of the database. Can any body suggest me how can i proceed with it? :confused: Thanks Raghavan (2 Replies)
Discussion started by: raghavan.aero
2 Replies

2. Shell Programming and Scripting

row to column and position data in to fixed column width

Dear friends, Below is my program and current output. I wish to have 3 or 4 column output in order to accomodate in single page. i do have subsequent command to process after user enter the number. Program COUNT=1 for MYDIR in `ls /` do VOBS=${MYDIR} echo "${COUNT}. ${MYDIR}" ... (4 Replies)
Discussion started by: baluchen
4 Replies

3. UNIX for Dummies Questions & Answers

convert # delimited text file to fixed width

Hello gurus, I have a file containing 5 columns delimited by '#' as shown in the example below: HRP1000-PLVAR#HRP1000-OTYPE#HRP1000-OBJID#HRP1000-BEGDA#HRP1000-ENDDA# 99991231#AU7129#000000000#1 PROCTER & GAMBLE# 99991231#TT4283#1000013883#21111 LAUNDRY# 99991231#TT4283#1000013884#21121 DISH... (3 Replies)
Discussion started by: chumsky
3 Replies

4. Shell Programming and Scripting

Ignore Header and Footer and Sort the data in fixed width file

Hi Experts, I want to Sort the data in fixed width file where i have Header and Footer also in file. I m using below commad to do the sort based on field satarting from 15 position to 17 position , but it is not ignoring the Header and Footer of the file while sorting. In the output i am... (5 Replies)
Discussion started by: sasikari
5 Replies

5. Shell Programming and Scripting

Parse tab delimited file, check condition and delete row

I am fairly new to programming and trying to resolve this problem. I have the file like this. CHROM POS REF ALT 10_sample.bam 11_sample.bam 12_sample.bam 13_sample.bam 14_sample.bam 15_sample.bam 16_sample.bam tg93 77 T C T T T T T tg93 79 ... (4 Replies)
Discussion started by: empyrean
4 Replies

6. Shell Programming and Scripting

[Solved] Append an header to a tab delimited file

Dear All, I would like to find an automatic way to add a given code which belong to a class at the end of the column , for example this is my input file: 0610009O20Rik V$VMYB_01 310 (+) 1 0.971 v-Myb V$EVI1_04 782 (-) 0.763 0.834 Evi-1 V$ELK1_02 1966 (-) 1 0.984 Elk-1... (4 Replies)
Discussion started by: paolo.kunder
4 Replies

7. UNIX for Dummies Questions & Answers

How to add a header to a tab delimited .txt file?

Hi, I have a tab delimited document with 18 columns. My file looks like: comp1000201_c0_seq1 comp1000201_c0 337 183.51 0.00 0.00 0.00 0.00 ---NA--- 337 0 0 - comp1000297_c0_seq1 comp1000297_c0 612 458.50 ... (1 Reply)
Discussion started by: alisrpp
1 Replies

8. Shell Programming and Scripting

Insert a header record (tab delimited) in multiple files

Hi Forum. I'm struggling to find a solution for the following issue. I have multiple files a1.txt, a2.txt, a3.txt, etc. and I would like to insert a tab-delimited header record at the beginning of each of the files. This is my code so far but it's not working as expected. for i in... (2 Replies)
Discussion started by: pchang
2 Replies

9. UNIX for Beginners Questions & Answers

awk to parse current and next row in tab-delimited file

Hi there, I would like to use awk to reformat a tab-delimited file containing three columns as follows: Data file: sample 1 173 sample 269 530 sample 687 733 sample 1699 1779 Desired output file: sample 174..265, 531..686, 734..1698 I need the value... (5 Replies)
Discussion started by: emiley
5 Replies

10. UNIX for Beginners Questions & Answers

Convert a fixed width file to a delimited file

Hi - this is a generic question .... is there any utility which can convert a fixed width file format to a delimited file (any given character delimited) ? (5 Replies)
Discussion started by: i4ismail
5 Replies
TBL(1)							      General Commands Manual							    TBL(1)

NAME
tbl - format tables for nroff or troff SYNOPSIS
tbl [ file ... ] DESCRIPTION
Tbl is a preprocessor for formatting tables for nroff or troff(1). The input files are copied to the standard output, except for segments of the form .TS options ; format . data .T& format . data . . . .TE which describe tables and are replaced by troff requests to lay out the tables. If no arguments are given, tbl reads the standard input. The (optional) options line is terminated by a semicolon and contains one or more of center center the table; default is left-adjust expand make table as wide as current line length box doublebox enclose the table in a box or double box allbox enclose every item in a box tab(x) use x to separate input items; default is tab linesize(n) set rules in n-point type delim(xy) recognize x and y as eqn(1) delimiters Each line, except the last, of the obligatory format describes one row of the table. The last line describes all rows until the next .T&, where the format changes, or the end of the table at .TE. A format is specified by key letters, one per column, either upper or lower case: L Left justify: the default for columns without format keys. R Right justify. C Center. N Numeric: align at decimal point (inferred for integers) or at S Span: extend previous column across this one. A Alphabetic: left-aligned within column, widest item centered, indented relative to L rows. ^ Vertical span: continue item from previous row into this row. - Draw a horizontal rule in this column. = Draw a double horizontal rule in this column. Key letters may be followed by modifiers, also either case: | Draw vertical rule between columns. || Draw a double vertical rule between columns. n Gap between column is n ens wide. Default is 3. Ffont Use specified font. B and I mean FB and FI. T Begin vertically-spanned item at top row of range; default is vertical centering (with Pn Use point size n. Vn Use n-point vertical spacing in text block; signed n means relative change. W(n) Column width as a troff width specification. Parens are optional if n is a simple integer. E Equalize the widths of all columns marked E. Each line of data becomes one row of the table; tabs separate items. Lines beginning with are troff requests. Certain special data items are recognized: _ Draw a horizontal rule in this column. = Draw a double horizontal rule in this column. A data line consisting of a single or draws the rule across the whole table. \_ Draw a rule only as wide as the contents of the column. Rx Repeat character x across the column. ^ Span the previous item in this column down into this row. T{ The item is a text block to be separately formatted by troff and placed in the table. The block continues to the next line begin- ning with T}. The remainder of the data line follows at that point. When it is used in a pipeline with eqn, the tbl command should be first, to minimize the volume of data passed through pipes. EXAMPLES
Let <tab> represent a tab (which should be typed as a genuine tab). .TS c s s c c s c c c l n n. Household Population Town<tab>Households <tab>Number<tab>Size Bedminster<tab>789<tab>3.26 Bernards Twp.<tab>3087<tab>3.74 Bernardsville<tab>2018<tab>3.30 .TE Household Population Town Households Number Size Bedminster 789 3.26 Bernards Twp. 3087 3.74 Bernardsville 2018 3.30 SOURCE
/sys/src/cmd/tbl SEE ALSO
troff(1), eqn(1), doctype(1) M. E. Lesk and L. L. Cherry, ``TBL--a Program to Format Tables'', Unix Research System Programmer's Manual, Tenth Edition, Volume 2. TBL(1)
All times are GMT -4. The time now is 06:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy