Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Presenting data in column format Post 302985757 by Don Cragun on Monday 14th of November 2016 11:13:18 PM
Old 11-15-2016
You might also try:
Code:
#!/bin/bash
cd /tmp/test
for file in *war.*
do	printf '%-25s %s\n' "${file%%.*}" "${file##*.}"
done

which, with the files you said were in that directory, produces the output:
Code:
AuroralMockService-1      deployed
EbillMock                 deployed
IAMAOGServices            deployed
IAMPermission             deployed
aal_mock                  deployed
consumerProfile           deployed
notificationservice       deployed
tibco_mock                deployed
tmo-iam-aa                deployed
tmo-iam-pm                deployed
tmo-iam-privacyvault      deployed
tmo-iam-provisioning      deployed
tmo-iam-provisioning      undeployed

This produces output in alphabetic order (instead of reverse modification time order) and the line shown in red does not appear in the output you said you wanted. Since most of the names you provided only contain two decimal points, I don't see how your code produced the output you said it did, but maybe this will give you some other ideas for extracting the data you want. If reverse time order is important, you could also try:
Code:
#!/bin/bash
cd /tmp/test
ls -tr *war.* | while IFS= read -r file
do	printf '%-25s %s\n' "${file%%.*}" "${file##*.}"
done

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

converting a tabular format data to comma seperated data in KSH

Hi, Could anyone help me in changing a tabular format output to comma seperated file pls in K-sh. Its very urgent. E.g : username empid ------------------------ sri 123 to username,empid sri,123 Thanks, Hema:confused: (2 Replies)
Discussion started by: Hemamalini
2 Replies

2. Shell Programming and Scripting

Format - Inventory Row data into Column - Awk - Nawk

Hi All, I have the following file that has computer data for various pcs in my network... Snap of the file is as follows ******************************************************************************* Serial 123456 Computer IP Address lo0:... (1 Reply)
Discussion started by: aavam
1 Replies

3. Shell Programming and Scripting

Extract data based on match against one column data from a long list data

My input file: data_5 Ali 422 2.00E-45 102/253 140/253 24 data_3 Abu 202 60.00E-45 12/23 140/23 28 data_1 Ahmad 256 7.00E-45 120/235 140/235 22 data_4 Aman 365 8.00E-45 15/65 140/65 20 data_10 Jones 869 9.00E-45 65/253 140/253 18... (12 Replies)
Discussion started by: patrick87
12 Replies

4. Shell Programming and Scripting

Sort a the file & refine data column & row format

cat file1.txt field1 "user1": field2:"data-cde" field3:"data-pqr" field4:"data-mno" field1 "user1": field2:"data-dcb" field3:"data-mxz" field4:"data-zul" field1 "user2": field2:"data-cqz" field3:"data-xoq" field4:"data-pos" Now i need to have the date like below. i have just... (7 Replies)
Discussion started by: ckaramsetty
7 Replies

5. Shell Programming and Scripting

Compare 2 files and match column data and align data from 3 column

Hello experts, Please help me in achieving this in an easier way possible. I have 2 csv files with following data: File1 08/23/2012 12:35:47,JOB_5330 08/23/2012 12:35:47,JOB_5330 08/23/2012 12:36:09,JOB_5340 08/23/2012 12:36:14,JOB_5340 08/23/2012 12:36:22,JOB_5350 08/23/2012... (5 Replies)
Discussion started by: asnandhakumar
5 Replies

6. UNIX for Dummies Questions & Answers

Changing data format from column into array

I have a file containing numbers in a column like: 10.5 16.3 15.7 2.3 46.8 3.3 . . . and I was wondering if there was a way to make it show up in an array form like: 10.5 2.3 16.3 46.8 15.7 3.3 Let's say I want to make a new column every 100 values. How can I do... (8 Replies)
Discussion started by: ShiGua
8 Replies

7. Shell Programming and Scripting

awk - script help: column to row format of data allignment?

Experts Good day, I have the following data, file1 BRAAGRP1 A2X B2X C2X D2X BRBGRP12 A3X B3X Z10 D09 BRC1GRP2 LO01 (4 Replies)
Discussion started by: rveri
4 Replies

8. UNIX for Dummies Questions & Answers

Des/awk for change format and adding integers in a column of data?

Greetings! I need a quick way to change the format in a table of data Here is an example of the input: 10 72 Value=177 VDB=0.0245 Value4=0,0,171,0 10 274 Value=238 VDB=0.0433 Value4=29,0,205,0 10 312 Value=222 VDB=0.0384 Value4=8,0,190,19 10 540 Value=405 VDB=0.0391 Value4=13,30,153,195... (3 Replies)
Discussion started by: Twinklefingers
3 Replies

9. Shell Programming and Scripting

Change data in one column with data from another file's column

Hello, I have this file outputData: # cat /tmp/outputData __Capacity^6^NBSC01_Licences^L3_functionality_for_ESB_switch __Capacity^2100^NBSC01_Licences^Gb_over_IP __Capacity^1837^NBSC01_Licences^EDGE_BSS_Fnc __Capacity^1816^NBSC01_Licences^GPRS_CS3_and_CS4... (1 Reply)
Discussion started by: nypreH
1 Replies
asadmin-show-component-status(1AS)				   User Commands				asadmin-show-component-status(1AS)

NAME
asadmin-show-component-status, show-component-status - displays the status of the deployed component SYNOPSIS
show-component-status --user admin_user [--password admin_password] [--host localhost] [--port 4848] [--secure|-s] [--passwordfile file- name] [--terse=false] [--echo=false] [--interactive] component_name show-component-status gets the status of the deployed component. The status is a string representation returned by the server. The possible status strings include: enabled or disabled. This command is supported in remote mode only. OPTIONS
--user authorized domain application server administrative username. --password password to administer the domain application server. --host machine name where the domain application server is running. --port port number of the domain application server listening for administration requests. --secure if true, uses SSL/TLS to communicate with the domain application server. --passwordfile file containing the domain application server password. --terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well- formatted data for consumption by a script. --echo setting to true will echo the command line statement on the standard output. --interactive prompts you for the required options that are not already specified. OPERANDS
component_name name of the component to be listed. Example 1: Using show-component-status asadmin> show-component-status sampleApplication Status of sampleApplication is enabled Where: the status of the sampleApplication application is shown. EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-list-components(1AS), asadmin-list-sub-components(1AS) J2EE 1.4 SDK March 2004 asadmin-show-component-status(1AS)
All times are GMT -4. The time now is 07:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy