Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Shell script, For loop output to excel as columns Post 303038932 by RudiC on Tuesday 17th of September 2019 09:40:33 AM
Old 09-17-2019
Hmmm - try
Code:
HD="Date"
DT="$(/bin/date "+%Y-%m-%d")"
ON="output/path/file.txt"
FN="App_log_${DT}_server"
TMP="Execution Complete "
for num in $servernums
  do  HD="$HD server${num}"
      DT="$DT $(grep "$TMP" $FN$num|wc -l)"
  done
[ ! -f "$ON" ] && echo $A $HD > "$ON"
echo $DT >> "$ON"


Last edited by RudiC; 09-19-2019 at 08:23 AM.. Reason: Corrected error $A --> $HD and braces around ${DT}
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sed subsitution on loop output in shell script

I have a forloop which checks a log for a set of 6 static IP addresses and each IP found is logged to a file which is then mailed to me. After the forloop I always have a text file that may contain up to 6 IP addresses or may contain 0. What I want to do is substitute the IP addresses (if any)... (2 Replies)
Discussion started by: Moxy
2 Replies

2. Shell Programming and Scripting

How to give a variable output name in a shell script inside a for loop

Hi all I run my program prog.c in the following way : $ ./prog 1 > output.txt where 1 is a user defined initial value used by the program. But now I want to run it for many a thousand initial values, 1-1000, and store all the outputs in different files. Like $ ./prog 1... (1 Reply)
Discussion started by: alice06
1 Replies

3. Shell Programming and Scripting

Script to parse TOP output for Excel

I'd like to parse TOP output file containing data like the below, and then be able to import the parsed file in to Excel where I can easily generate graphs. Ideally, the output would have a single column for each value in the output. Any thoughts on how to get started with this, or a better... (3 Replies)
Discussion started by: NoMasVentanas
3 Replies

4. Shell Programming and Scripting

Problem in formatting output of SQL query in excel sheet in shell script

Hi Guys.. Need your help to format the output of my shell script. I am using spool command to take out put in csv file. below is my code. (for example) col USERNAME for a15 col EMAIL for a30 col FULL_NAME for a20 col LAST_LOGIN for a40 col DATE_CREATED for a40 SPOOL 120.csv... (3 Replies)
Discussion started by: Agupte
3 Replies

5. Shell Programming and Scripting

Formatting Shell script output to Excel

I am facing a problem formatting the output of my shell script in excel. We are directing the output of the script to an excel sheet and need long integer type data printed in Excel as it is (i.e. not in the default scientific notation). Also, leading zeroes(if any) in the output are getting... (4 Replies)
Discussion started by: bornali.p
4 Replies

6. Shell Programming and Scripting

Excel from shell script

Is it possible to generate excel sheet from a shell script and rename the worksheet..? Thanks for your answer (1 Reply)
Discussion started by: Anu_1
1 Replies

7. Shell Programming and Scripting

Shell do loop to compare two columns (duplicates)

Hello, I have a single text file with three columns like: 2 1 10 3 6 11 4 4 12 5 5 13 6 8 14 I was wondering how I can run a shell script to (do loop) to read the first point in the first column , compare it with all the points in the second column and if they are the same,... (12 Replies)
Discussion started by: Paul Moghadam
12 Replies

8. Shell Programming and Scripting

Script to generate Excel file or to SQL output data to Excel format/tabular format

Hi , i am generating some data by firing sql query with connecting to the database by my solaris box. The below one should be the header line of my excel ,here its coming in separate row. TO_CHAR(C. CURR_EMP_NO ---------- --------------- LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies

9. Shell Programming and Scripting

Perl script to accept specific columns from excel

Hi All, I have below perl script which writes xml from .xls file. Now i want to add below two conditions in this script : 1. to check if the the input .xls file has ony two columns , if more tahn two columns then script should pop up an error. 2. If there are two columns , then first column... (4 Replies)
Discussion started by: omkar.jadhav
4 Replies

10. UNIX for Beginners Questions & Answers

For loop output to excel file

Hi, I have a shell script which analyses the log folder for a specific string and throws me the output. I have used for loop since it does this in multiple servers. Now I want to save the output in a excel in the below format. Can someone please help? The output which I get Server1 : count... (1 Reply)
Discussion started by: srilaxman
1 Replies
TCBTEST(1)							   Tokyo Cabinet							TCBTEST(1)

NAME
tcbtest - test cases of the B+ tree database API DESCRIPTION
The command `tcbtest' is a utility for facility test and performance test. This command is used in the following format. `path' specifies the path of a database file. `rnum' specifies the number of iterations. `lmemb' specifies the number of members in each leaf page. `nmemb' specifies the number of members in each non-leaf page. `bnum' specifies the number of buckets. `apow' specifies the power of the alignment. `fpow' specifies the power of the free block pool. tcbtest write [-mt] [-cd|-ci|-cj] [-tl] [-td|-tb|-tt|-tx] [-lc num] [-nc num] [-xm num] [-df num] [-ls num] [-ca num] [-nl|-nb] [-rnd] path rnum [lmemb [nmemb [bnum [apow [fpow]]]]] Store records with keys of 8 bytes. They change as `00000001', `00000002'... tcbtest read [-mt] [-cd|-ci|-cj] [-lc num] [-nc num] [-xm num] [-df num] [-nl|-nb] [-wb] [-rnd] path Retrieve all records of the database above. tcbtest remove [-mt] [-cd|-ci|-cj] [-lc num] [-nc num] [-xm num] [-df num] [-nl|-nb] [-rnd] path Remove all records of the database above. tcbtest rcat [-mt] [-cd|-ci|-cj] [-tl] [-td|-tb|-tt|-tx] [-lc num] [-nc num] [-xm num] [-df num] [-ls num] [-ca num] [-nl|-nb] [-pn num] [-dai|-dad|-rl|-ru] path rnum [lmemb [nmemb [bnum [apow [fpow]]]]] Store records with partway duplicated keys using concatenate mode. tcbtest queue [-mt] [-cd|-ci|-cj] [-tl] [-td|-tb|-tt|-tx] [-lc num] [-nc num] [-xm num] [-df num] [-ls num] [-ca num] [-nl|-nb] path rnum [lmemb [nmemb [bnum [apow [fpow]]]]] Perform queueing and dequeueing. tcbtest misc [-mt] [-tl] [-td|-tb|-tt|-tx] [-nl|-nb] path rnum Perform miscellaneous test of various operations. tcbtest wicked [-mt] [-tl] [-td|-tb|-tt|-tx] [-nl|-nb] path rnum Perform updating operations selected at random. Options feature the following. -mt : call the function `tchdbsetmutex'. -cd : use the comparison function `tccmpdecimal'. -ci : use the comparison function `tccmpint32'. -cj : use the comparison function `tccmpint64'. -tl : enable the option `BDBTLARGE'. -td : enable the option `BDBTDEFLATE'. -tb : enable the option `BDBTBZIP'. -tt : enable the option `BDBTTCBS'. -tx : enable the option `BDBTEXCODEC'. -lc num : specify the number of cached leaf pages. -nc num : specify the number of cached non-leaf pages. -xm num : specify the size of the extra mapped memory. -df num : specify the unit step number of auto defragmentation. -ls num : specify the maximum size of each leaf page. -ca num : specify the capacity number of records. -nl : enable the option `BDBNOLCK'. -nb : enable the option `BDBLCKNB'. -rnd : select keys at random. -wb : use the function `tcbdbget3' instead of `tcbdbget'. -pn num : specify the number of patterns. -dai : use the function `tcbdbaddint' instead of `tcbdbputcat'. -dad : use the function `tcbdbadddouble' instead of `tcbdbputcat'. -rl : set the length of values at random. -ru : select update operations at random. This command returns 0 on success, another on failure. SEE ALSO
tcbmttest(1), tcbmgr(1), tcbdb(3), tokyocabinet(3) Man Page 2012-08-18 TCBTEST(1)
All times are GMT -4. The time now is 09:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy