I am trying to show my list, from a simple list format to a table (row and column formatted table)
Currently i have this format in my output (the formart it will always be like this ) >> first 3 lines must be on the same line aligned, and the next 3 shud be on 2nd line....:
And the output format i'm trying to acquire is as follow
I was wondering if you could give me some hints on how to achieve this.
Thank You
Last edited by Scrutinizer; 01-27-2013 at 06:57 AM..
Reason: quote tags => code tags
This line of code is doing what I asked for. But I have one question, There is only a one space difference btw the different data in one line and it's not well aligned.
To fix this I tried to modify the code like this
and
But no luck, If the solution to my problem is easy can u please indicate to me which one i shud change.
Here are three different awk scripts to do this making different assumptions about the number of columns/row, and width of columns. If you input data is always less that 8 output columns per input line and you always have three input lines per output row, the 1st script is very simple.
If your input data has input lines that vary in length, but there are always three input lines per output row, the 2nd awk script below adjusts the output to match input field widths.
If you have a variable number of input lines per output row but the column 1 input line data always ends with a colon, the 3rd awk script below will adjust the number of rows and column widths based on the input file contents.
Here are the three awk scripts:
When these three scripts are given the a file named input containing:
the output produced is:
As always, if you're using a Solaris/Sun OS system, use /usr/xpg4/bin/awk or nawk instead of awk.
This User Gave Thanks to Don Cragun For This Post:
@bipinajith
You set the c=0 in all your example.
This is not needed, since a non declared variable is 0, so this can be removed on all your example.
is the same as
Hi,
OS: Redhat 7.5
shell: Bash
Wrote below script to login into oracle via shell script and trying to reset locked account..It works as expected. But I need specific output << EOF should go to target terminal not all out put
running below script from ansible command line..
#!/bin/bash... (1 Reply)
I have one script which generate file called report.txt having following output
parameter_name status comment
banking ok NA
finance 30% hike NA
Loan_department ok 20%
HR_Group defaulters Ajay
I wanted to convert this file into tabular form.
You can see each line contain 3 words and... (7 Replies)
Hi All,
I have a output like below values
val1=test.com
val2=10.26.208.11
val3=en1
val4=test-priv1.com
val5=192.168.3.4
val6=en2
val7=test-priv2.com
val8=192.168.4.4
val9=en3
val10=test-vip.com
val11=10.26.208.9
val12=$val3
I want to convet this output values into below... (1 Reply)
My Code
Hi Friends,
I need to get output in table format using unix shell script.For example my server CPU and memory utilization report will come as a mail with ordinary format but i want to make as table format.
Here two output finally we are getting:-
CPU utilization is... (2 Replies)
Hi,
I have EBCDIC format file and i wold like to convert normal string(user readable) in unix .
The source having the binary IBM file format
Sample Source Format:
... (3 Replies)
hi guys,
i have a data with a column of p value (normal format and scientific combined). i want to creat a subset of data which only contains p-value:
data 1: p<10^7
data 2: p<0.01
how should i do it? many thanks!
data looks like:
rs7841347 128887490 1.695e-007
rs1241347 ... (4 Replies)
Hello,
Could you please let me know the correct format of CREATE TABLE statement with DATE format.
CREATE TABLE EMP_TABLE1 (
NAME VARCHAR(6) PRIMARY KEY,
ADDRESS VARCHAR(6),
BIRTH_DATE DATE
);
I want BIRTH_DATE to be in "YYYYMMDDHHMISS" format.
How we can create table with... (4 Replies)
Dear all-
I have a requirement to send an email via email with body content which looks something below-
Email body contents
--------------------
RequestType: Update
DateAcctOpened: 1/5/2010
Note that header information and data content should be normal text..
Please advice on... (5 Replies)
I have a file named "suspected" with series of line like these :
{'protocol': 17, 'service': 'BitTorrent KRPC', 'server': '219.78.120.166', 'client_port': 52044, 'client': '10.64.68.44', 'server_port': 8291, 'time': 1226506312L, 'serverhostname': ''}
{'protocol': 17, 'service': 'BitTorrent... (3 Replies)