Sponsored Content
Top Forums Shell Programming and Scripting How to format output in columns by appending multi lines one by one? Post 302898967 by ketanraut on Friday 25th of April 2014 09:02:00 AM
Old 04-25-2014
How to format output in columns by appending multi lines one by one?

Hi,
I need to display output in below format
Customer : Apr 24 16:31 Customer_Name_111121.txt
|---Space---|Apr 24 16:32 Customer_Name _111121. txt
|---Space---|Apr 24 16:34 Customer_Name_111112. txt
|---Space---|Apr 24 16:35 Customer_Name _222223. txt
|---Space---|Apr 24 16:37 Customer_Name_999999. txt
Brain-UCG : Apr 24 16:35 User_config_20140107.dat
|---Space---|Apr 24 16:36 User_config_20140110.dat
|---Space---|Apr 24 16:36 User_config_20140109.dat

I am using below command and getting Output like:-

Code:
FILE_LIST="$FILE_LIST$(printf '\t\t\t\t%-19s' " $FILE_NAME")$(printf '%-5s' ":")$(ls -ltr | grep -w "Apr 24" |  awk -F ' ' '{print $6,$7,$8,$9}')"$'\n'
 paste <(printf '  %-5s' "$FILE_LIST")

Customer : Apr 24 16:31 Customer_Name_111121.txt
Apr 24 16:32 Customer_Name _111121. txt
Apr 24 16:34 Customer_Name_111112. txt
Apr 24 16:35 Customer_Name _222223. txt
Apr 24 16:37 Customer_Name_999999. txt
Brain-UCG : Apr 24 16:35 User_config_20140107.dat
Apr 24 16:36 User_config_20140110.dat
Apr 24 16:36 User_config_20140109.dat

Customer,User are the name of files which call one by one in $FILE_NAME
Could you please let me know what I have missed to get desire output

Thanks,
kraut
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Appending columns on a file

My issue is the following: I have several text files, let's say 10 of them. Each one has three columns separated by a tab: Date, Time and Value. What I want to do next is to have only one text file containing the information: Date, Time, Value1, Value2, Value3, ... , Value10, where Value1... (2 Replies)
Discussion started by: abel
2 Replies

2. Shell Programming and Scripting

need help appending lines/combining lines within a file...

Is there a way to combine two lines onto a single line...append the following line onto the previous line? I have the following file that contains some blank lines and some lines I would like to append to the previous line... current file: checking dsk c19t2d6 checking dsk c19t2d7 ... (2 Replies)
Discussion started by: mr_manny
2 Replies

3. UNIX for Dummies Questions & Answers

To convert multi format file to a readable ascii format

Hi I have a file which has ascii , binary, binary decimal coded,decimal & hexadecimal data with lot of special characters (like öƒ.ƒ.„İİ¡Š·œƒ.„İİ¡Š· ) in it. I want to standardize the file into ASCII format & later use that as source . Can any one suggest a way a logic to convert such... (5 Replies)
Discussion started by: gaur.deepti
5 Replies

4. Shell Programming and Scripting

Cronjob - Redirect mail output to file, LINES & COLUMNS

I currently have an expect script that issues the 'mail' command and sends an 'x' when it receives the & prompt from mail to quit. The expect script is able to do stty rows 100 columns 200 < $spawn_out(slave,name) to set up the number of columns and rows. I would like to get rid of the expect... (0 Replies)
Discussion started by: jharvey
0 Replies

5. Shell Programming and Scripting

Appending the last few columns to the front

Hi consider this as the first line 00010015 MORGAN STANLEY & CO INCORPORATED N 110 INVESTAR 1 0001OT NJ 201-830-5055 01-Jan-1974 00:00:00 1 01-May-2008 00:00:00 05-Jun-2008 13:34:18 0001 - From SMSRun1_GIDQA02 Consider this as the second line 00010015 MORGAN STANLEY... (3 Replies)
Discussion started by: ragavhere
3 Replies

6. Shell Programming and Scripting

incrementing lines in the file & format output.

Hi All, I need read the file and out put format as below using ksh, I wrote below script its keep on repeating first line in the file. may i know the best way to get the below out put while incrementing line in the file. cat b.txt |awk '{print $0}' |while read line do aa=`cat $line |head -1... (7 Replies)
Discussion started by: ashanabey
7 Replies

7. UNIX for Dummies Questions & Answers

Appending columns at the end of output using awk/sed

Hi , I have the below ouput, =====gopi===== assasassaa adsadsadsdsada asdsadsadasdsa sadasdsadsd =====kannan=== asdasdasd sadasddsaasd adasdd =====hbk=== asasasssa .... .. I want the output like as below, not able paste here correctly. (2 Replies)
Discussion started by: eeegopikannan
2 Replies

8. Shell Programming and Scripting

Format output into columns, variables with multiple entries

Hello all, I've got a script that collects data on file systems and prints out specific data about each. I've formatted headers w/ printf like so. printf "\033 and I had the content of the varibles printed out beneath those columns like so: printf... (5 Replies)
Discussion started by: awreneau
5 Replies

9. Shell Programming and Scripting

Sum of columns and format the output

Input file: 011100020100 0.00 1 20000 30000 20000 011110000025 0.00 1 000 240000 10000 011100020100 0.00 1 200000 2324000 403500 032200030025 0.00 1 2077500 3077500 250000 032200030025 0.00 1 2565000 25536400 320000 022220000005 0.00 1 10000 300000 300000 022220000005 0.00 1 200050... (7 Replies)
Discussion started by: vinus
7 Replies

10. Shell Programming and Scripting

Split multi columns line to 2 columns

I have data like this 1 a,b,c 2 a,c 3 b,d 4 e,f would like convert like this 1 a 1 b 1 c 2 a 2 c 3 b 3 d 4 e 4 f Please help me out (4 Replies)
Discussion started by: jhonnyrip
4 Replies
MATRIX(9.2)															       MATRIX(9.2)

NAME
ident, matmul, matmulr, determinant, adjoint, invertmat, xformpoint, xformpointd, xformplane, pushmat, popmat, rot, qrot, scale, move, xform, ixform, persp, look, viewport - Geometric transformations SYNOPSIS
#include <libg.h> #include <geometry.h> void ident(Matrix m) void matmul(Matrix a, Matrix b) void matmulr(Matrix a, Matrix b) double determinant(Matrix m) void adjoint(Matrix m, Matrix madj) double invertmat(Matrix m, Matrix inv) Point3 xformpoint(Point3 p, Space *to, Space *from) Point3 xformpointd(Point3 p, Space *to, Space *from) Point3 xformplane(Point3 p, Space *to, Space *from) Space *pushmat(Space *t) Space *popmat(Space *t) void rot(Space *t, double theta, int axis) void qrot(Space *t, Quaternion q) void scale(Space *t, double x, double y, double z) void move(Space *t, double x, double y, double z) void xform(Space *t, Matrix m) void ixform(Space *t, Matrix m, Matrix inv) int persp(Space *t, double fov, double n, double f) void look(Space *t, Point3 eye, Point3 look, Point3 up) void viewport(Space *t, Rectangle r, double aspect) DESCRIPTION
These routines manipulate 3-space affine and projective transformations, represented as 4x4 matrices, thus: typedef double Matrix[4][4]; Ident stores an identity matrix in its argument. Matmul stores axb in a. Matmulr stores bxa in b. Determinant returns the determinant of matrix m. Adjoint stores the adjoint (matrix of cofactors) of m in madj. Invertmat stores the inverse of matrix m in minv, returning m's determinant. Should m be singular (determinant zero), invertmat stores its adjoint in minv. The rest of the routines described here manipulate Spaces and transform Point3s. A Point3 is a point in three-space, represented by its homogeneous coordinates: typedef struct Point3 Point3; struct Point3{ double x, y, z, w; }; The homogeneous coordinates (x, y, z, w) represent the Euclidean point (x/w, y/w, z/w) if w!=0, and a ``point at infinity'' if w=0. A Space is just a data structure describing a coordinate system: typedef struct Space Space; struct Space{ Matrix t; Matrix tinv; Space *next; }; It contains a pair of transformation matrices and a pointer to the Space's parent. The matrices transform points to and from the ``root coordinate system,'' which is represented by a null Space pointer. Pushmat creates a new Space. Its argument is a pointer to the parent space. Its result is a newly allocated copy of the parent, but with its next pointer pointing at the parent. Popmat discards the Space that is its argument, returning a pointer to the stack. Nominally, these two functions define a stack of transformations, but pushmat can be called multiple times on the same Space multiple times, creating a transformation tree. Xformpoint and Xformpointd both transform points from the Space pointed to by from to the space pointed to by to. Either pointer may be null, indicating the root coordinate system. The difference between the two functions is that xformpointd divides x, y, z, and w by w, if w!=0, making (x, y, z) the Euclidean coordinates of the point. Xformplane transforms planes or normal vectors. A plane is specified by the coefficients (a, b, c, d) of its implicit equation ax+by+cz+d=0. Since this representation is dual to the homogeneous representation of points, libgeometry represents planes by Point3 structures, with (a, b, c, d) stored in (x, y, z, w). The remaining functions transform the coordinate system represented by a Space. Their Space * argument must be non-null -- you can't mod- ify the root Space. Rot rotates by angle theta (in radians) about the given axis, which must be one of XAXIS, YAXIS or ZAXIS. Qrot trans- forms by a rotation about an arbitrary axis, specified by Quaternion q. Scale scales the coordinate system by the given scale factors in the directions of the three axes. Move translates by the given displace- ment in the three axial directions. Xform transforms the coordinate system by the given Matrix. If the matrix's inverse is known a priori, calling ixform will save the work of recomputing it. Persp does a perspective transformation. The transformation maps the frustum with apex at the origin, central axis down the positive y axis, and apex angle fov and clipping planes y=n and y=f into the double-unit cube. The plane y=n maps to y'=-1, y=f maps to y'=1. Look does a view-pointing transformation. The eye point is moved to the origin. The line through the eye and look points is aligned with the y axis, and the plane containing the eye, look and up points is rotated into the x-y plane. Viewport maps the unit-cube window into the given screen viewport. The viewport rectangle r has r.min at the top left-hand corner, and r.max just outside the lower right-hand corner. Argument aspect is the aspect ratio (dx/dy) of the viewport's pixels (not of the whole viewport). The whole window is transformed to fit centered inside the viewport with equal slop on either top and bottom or left and right, depending on the viewport's aspect ratio. The window is viewed down the y axis, with x to the left and z up. The viewport has x increas- ing to the right and y increasing down. The window's y coordinates are mapped, unchanged, into the viewport's z coordinates. SOURCE
/sys/src/libgeometry/matrix.c MATRIX(9.2)
All times are GMT -4. The time now is 08:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy