Sponsored Content
Top Forums UNIX for Beginners Questions & Answers UNIX shell script for matrix insertion into a file Post 303042125 by jim mcnamara on Sunday 15th of December 2019 11:37:05 PM
Old 12-16-2019
Does the input data ALWAYS have three lines -> two lines of output? It looks like it varies and a date is the key header item.
That means you need to tell us exactly what the data looks like - dates are awful if they are freehand:
ex:
Code:
April 4, 2108
20180404
04/04/18
2018-4-4

are all the same date and checking every possibility is not likely to happen reliably.

We need a couple of sample data input "blocks" to be of any help to you.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Unix file operations(shell script)

Hi, I want to compare two files. Files will look like as follows: file1: ASDFGHJU|1234567890123456 QWERTYUI|3456789098900890 file2: ZXCVBVNM|0987654321234567 POLKIJUYH|1234789060985478 output file should be: ASDFGHJU|1234567890123456 QWERTYUI|3456789098900890 Thnaks in advance (6 Replies)
Discussion started by: nivas
6 Replies

2. Shell Programming and Scripting

Is it possible to draw table/matrix using shell script?

Hi all, I need to create a matrix of variable rows and columns. Right now i have 3 rows and two columns and following values. Output something like TypeA TypeB TestCase1 Pass Fail TestCase2 Pass ... (2 Replies)
Discussion started by: jakSun8
2 Replies

3. Shell Programming and Scripting

(Urgent):Creating flat file using sql script and sqlplus from UNIX Shell Script

Hi, I need help urgently for following issue. Pls help me to resolve this issue. I am calling sql script file(file1.sql) from UNIX Shell Script(script1.ksh) using sql plus and trying to create flat file that contains all records returned from SQL query in SQL script(file1.sql) I given... (6 Replies)
Discussion started by: praka
6 Replies

4. Shell Programming and Scripting

insertion of text from sed script

Hi , This is my first thread ; facing some issues withmy sed script I need to insert the code from my log file which is between two keywords. content is like this ........ log ############################ log1 log2 231 "Ban" "tom" and the line one of the cross line friend... (2 Replies)
Discussion started by: shalini_008
2 Replies

5. Shell Programming and Scripting

Insertion in a file

Hi All, I want to insert a line just befor the lst line in a file. please can anyone advise. Cheers, Shazin (3 Replies)
Discussion started by: Shazin
3 Replies

6. Shell Programming and Scripting

Execute unix shell script to text file using the script

Hi all, I am beginner in UNIX...I want to use unix shell script to create text.file...I know how to use using by command...can anybody tell me for the script? Thanks i changed the threads title from "tex file" to "text file", because "tex" would probably be misunderstood as reference to... (4 Replies)
Discussion started by: mastercar
4 Replies

7. Shell Programming and Scripting

AWK script problem insertion of code

Hi , I am having two files like this FILE1 #################### input SI_TESTONLY_R_00; input CE0_SE_INPUT_TESTONLY; input CE0_TCLK_TESTONLY; input SI_JTGCLOCKDR_JTAG_R_00; input CE0_TCLK_JTGCLOCKDR_JTAG; input CE0_SE_INPUT_JTGCLOCKDR_JTAG; output SO_TESTONLY_R_00; output... (2 Replies)
Discussion started by: jaita
2 Replies

8. Shell Programming and Scripting

UNIX Shell script to work with .xml file

Hi Team, Could you please help me on below query: I want to retrieve XML elements from one .xml file. This .xml file has commented tags as well. so i am planning to write Unix command/script which 1.will chekc for this .xml file 2. it will ignore the commented XML lines. i.e. XML tags between... (3 Replies)
Discussion started by: waiting4u
3 Replies

9. Shell Programming and Scripting

UNIX shell script to search a string in a file

Hi folks, I am new for shell script, I hope somebody to help me to write shell script My requirement is below steps 1. I have apache access.log i.e located in /var/log/httpd/ Ex. 127.0.0.1 - - "GET... (14 Replies)
Discussion started by: Chenchireddy
14 Replies

10. UNIX for Beginners Questions & Answers

Shell script to Split matrix file with delimiter into multiple files

I have a large semicolon delimited file with thousands of columns and many thousands of line. It looks like: ID1;ID2;ID3;ID4;A_1;B_1;C_1;A_2;B_2;C_2;A_3;B_3;C_3 AA;ax;ay;az;01;02;03;04;05;06;07;08;09 BB;bx;by;bz;03;05;33;44;15;26;27;08;09 I want to split this table in to multiple files: ... (1 Reply)
Discussion started by: trymega
1 Replies
tbl(1)							      General Commands Manual							    tbl(1)

NAME
tbl - format tables for nroff SYNOPSIS
[file ...] DESCRIPTION
is a preprocessor that formats tables for nroff(1). The input files are copied to the standard output, except for lines between and com- mand lines, which are assumed to describe tables and are re-formatted by (The and command lines are not altered by is followed by global options. The available global options are: center the table (default is left-adjust); make the table as wide as the current line length; enclose the table in a box; enclose the table in a double box; enclose each item of the table in a box; use the character x instead of a tab to separate items in a line of input data. The global options, if any, are terminated with a semi-colon Next come lines describing the format of each line of the table. Each such format line describes one line of the actual table, except that the last format line (which must end with a period) describes all remaining lines of the table. Each column of each line of the table is described by a single key-letter, optionally followed by specifiers that determine the font and point size of the corresponding item, indi- cate where vertical bars are to appear between columns, or determine column width, inter-column spacing, etc. The available key-letters are: center item within the column; right-adjust item within the column; left-adjust item within the column; numerically adjust item in the column: units positions of numbers are aligned vertically; span previous item on the left into this column; center longest line in this column, then left-adjust all other lines in this column with respect to that centered line; span down previous entry in this column; replace this entry with a horizontal line; replace this entry with a double horizontal line. The characters and stand for the bold (font position 3) and italic (font position 2) fonts, respectively; the character indicates a verti- cal line between columns. The format lines are followed by lines containing the actual data for the table, followed finally by Within such data lines, data items are normally separated by tab characters. If a data line consists of only or a single or double line, respectively, is drawn across the table at that point; if a single item in a data line consists of only or then that item is replaced by a single or double line. The option forces to use only full vertical line motions, making the output more suitable for devices that cannot generate partial vertical line motions (such as line printers). If no file names are given as arguments (or if is specified as the last argument), reads the standard input, and thus can be used as a fil- ter. When used with should be used first to minimize the volume of data passed through pipes (see neqn(1)). EXTERNAL INFLUENCES
Environment Variables determines the interpretation of text as single- and/or multi-byte characters. determines the radix character used in numerical data. determines the language in which messages are displayed. If or is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty variable. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of If any internationalization vari- able contains an invalid setting, behaves as if all internationalization variables are set to "C". See environ(5). International Code Set Support Single- and multi-byte character code sets are supported. EXAMPLES
If we redefine the tab character to a semicolon, then the input: yields: +------------------------------+ | Household Population | +--------------+---------------+ | Town | Households | | | Number Size | +--------------+---------------+ |Bedminster | 789 3.26 | |Bernards Twp. | 3087 3.74 | |Bernardsville | 2018 3.30 | |Bound Brook | 3425 3.04 | |Bridgewater | 7897 3.81 | |Far Hills | 240 3.19 | +--------------+---------------+ The command is used most often with and (see col(1)). A common usage is: WARNINGS
See WARNINGS under nroff(1). SEE ALSO
col(1), mm(1), neqn(1), nroff(1), soelim(1), mm(5). tbl(1)
All times are GMT -4. The time now is 10:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy