Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to simulate column command in Solaris? Post 303039577 by newbie_01 on Wednesday 9th of October 2019 10:21:10 PM
Old 10-09-2019
How to simulate column command in Solaris?

Hi,

Does anyone know how to have a similar output like below on Solaris without using column?
The output below is on Linux that uses the column and there is no column command in Solaris.

Code:
$ sort /tmp/x.txt | uniq | column -c 50
csfd0   csfd5   mchd11  mchp1   mpeq2   nocd20
csfd1   csfd8   mchd12  mcht1   mpet1   nocd3
csfd10  csfd9   mchd15  mcht11  nocd0   nocd5
csfd11  csft1   mchd2   mcht3   nocd1   nocd8
csfd12  csft11  mchd20  mped0   nocd10  nocd9
csfd15  csft3   mchd3   mped1   nocd11  nocp1
csfd2   mchd0   mchd5   mped10  nocd12  noct1
csfd20  mchd1   mchd8   mped15  nocd15  noct11
csfd3   mchd10  mchd9   mped20  nocd2   noct3

Found this command via Googling. This is more or less what am after but I want to put more spaces between columns though? Any tips on how to do this?

Code:
$: sort /tmp/x.txt | uniq | paste -s -d"\t\t\t\t\t\t\t\\t\n" -
csfd0   csfd1   csfd10  csfd11  csfd12  csfd15  csfd2   csfd20  csfd3
csfd5   csfd8   csfd9   csft1   csft11  csft3   mchd0   mchd1   mchd10
mchd11  mchd12  mchd15  mchd2   mchd20  mchd3   mchd5   mchd8   mchd9
mchp1   mcht1   mcht11  mcht3   mped0   mped1   mped10  mped15  mped20
mpeq2   mpet1   nocd0   nocd1   nocd10  nocd11  nocd12  nocd15  nocd2
nocd20  nocd3   nocd5   nocd8   nocd9   nocp1   noct1   noct11  noct3


Last edited by newbie_01; 10-10-2019 at 07:39 AM.. Reason: More information
 

9 More Discussions You Might Find Interesting

1. IP Networking

Simulate 'try again' case

Hi, I was searching thro the topic and could not find a thread which zeroes in on the case i'm trying to simulate. Basically I have a need to simulate DNS Try again cases, without bringing the dns_sever down (by manipulating the entries in /etc/resolv.conf under 'nameserver' tag). I am so... (5 Replies)
Discussion started by: srinivasan_85
5 Replies

2. UNIX for Dummies Questions & Answers

Newbie: Simulate unix on my pc

Hi, i am new with unix. Just came back from a course, unix basics for aix. So for me to practice, i want to install a simulation program for unix om my Windows Xp pc. Dual boot must it be. Does anybody have a suggestion for this dummy??? Thnx! Paul (5 Replies)
Discussion started by: welbp00
5 Replies

3. UNIX for Advanced & Expert Users

Simulate CRON job

Does anyone know how I can simulate a cron job execution via UNIX scripting or is there a command/tool that simulate this? I have a file I called "appSchedule.txt", it contains below lines: 00 03 * * 1-6 RED start 00 06 * * 0 RED start 00 21 * * * RED stop 00 03 * * 1-6 ... (1 Reply)
Discussion started by: Orbix
1 Replies

4. Programming

Tool to simulate non-sequential disk I/O (simulate db file sequential read) in C POSIX

Writing a Tool to simulate non-sequential disk I/O (simulate db file sequential read) in C POSIX I have over the years come across the same issue a couple of times, and it normally is that the read speed on SAN is absolutely atrocious when doing non-sequential I/O to the disks. Problem being of... (7 Replies)
Discussion started by: vrghost
7 Replies

5. Shell Programming and Scripting

command for converting 4 column data to 1 column

dear friends I want to convert four column data to one column data. For example: from 1, 2, 3, 4 5, 6, 7, 8to 1 2 3 4 5 6 7 8what is the general command for that type of convertion. thanks (5 Replies)
Discussion started by: rpf
5 Replies

6. Shell Programming and Scripting

awk command to print only selected rows in a particular column specified by column name

Dear All, I have a data file input.csv like below. (Only five column shown here for example.) Data1,StepNo,Data2,Data3,Data4 2,1,3,4,5 3,1,5,6,7 3,2,4,5,6 5,3,5,5,6 From this I want the below output Data1,StepNo,Data2,Data3,Data4 2,1,3,4,5 3,1,5,6,7 where the second column... (4 Replies)
Discussion started by: ks_reddy
4 Replies

7. UNIX for Dummies Questions & Answers

Sort command in one column and not effect to another column

If my data is numerical : 1 = 101 2 = 102 3 = 104 4 = 104 7 = 103 8 = 103 9 = 105 I need the result like below: 1 = 101 2 = 102 3 = 103 4 = 103 7 = 104 8 = 104 9 = 105 (4 Replies)
Discussion started by: GeodusT
4 Replies

8. Red Hat

Simulate Storage

Hello, I wanted to simulate SAN on my VMware PLayer running RHEL. Is there any tool that can be used to simulate storage setup for learning/testing? THanks, (1 Reply)
Discussion started by: ikn3
1 Replies

9. Shell Programming and Scripting

Simulate enter key

I have a popup window that appears on every boot up. I would like to have it dismissed automatically each time instead of having to hit the enter key. I thought I could write a script that would execute on startup. I tried this xdotool key return andy@7_~/Downloads$ xdotool key ... (7 Replies)
Discussion started by: drew77
7 Replies
DB2_FIELD_PRECISION(3)							 1						    DB2_FIELD_PRECISION(3)

db2_field_precision - Returns the precision of the indicated column in a result set

SYNOPSIS
int db2_field_precision (resource $stmt, mixed $column) DESCRIPTION
Returns the precision of the indicated column in a result set. PARAMETERS
o $stmt - Specifies a statement resource containing a result set. o $column - Specifies the column in the result set. This can either be an integer representing the 0-indexed position of the column, or a string containing the name of the column. RETURN VALUES
Returns an integer containing the precision of the specified column. If the specified column does not exist in the result set, db2_field_precision(3) returns FALSE. SEE ALSO
db2_field_display_size(3), db2_field_name(3), db2_field_num(3), db2_field_scale(3), db2_field_type(3), db2_field_width(3). PHP Documentation Group DB2_FIELD_PRECISION(3)
All times are GMT -4. The time now is 11:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy