Sponsored Content
Full Discussion: Modifying output column
Top Forums Shell Programming and Scripting Modifying output column Post 302837031 by Jotne on Thursday 25th of July 2013 04:36:38 AM
Old 07-25-2013
Some more clean version that can be expanded if needed.
Code:
awk '	{ printf $1; test($2); test($3); print "" }

	function test(num)
	{if (num~/pin[0-9][0-9][A-E]/) printf " %.5sA",num; 
	else if (num~/pin[0-9][0-9][F-J]/) printf " %.5sF",num;
	else printf " error"}
	' file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Modifying the final output file

Hey all, I am haivng n number of files all of them are of the same format but different details. i.e File1 is having the folloeing details: "Account1",123 "Account2",10 "Account3",12355 "Accountn",555 File2 is having the folloeing details: "Account1",1234 "Account2",100... (5 Replies)
Discussion started by: charbel
5 Replies

2. Shell Programming and Scripting

Sub. numbers in column of output with If

This is my script. I am pulling the status of some hard where, but the status is in numerical form. The number 4 means Major and the 5 means Critical. In my script I would like to show the alarm type in aplha rather than numeric form. So if instead of seeing a 4 or 5 you would see MAjor or... (11 Replies)
Discussion started by: ja156194
11 Replies

3. UNIX Desktop Questions & Answers

Loop column output

I need help in what to do with a bash script? I'm trying to run a command to output the data from a table and then insert it into commands. Looping for each row of data. For example the output data from a table: 10 John house 20 Jane apt 30 Joe townhomeThen I need to take the output... (1 Reply)
Discussion started by: handband2
1 Replies

4. Shell Programming and Scripting

4 column tsv file, output 1 specific column

Hello all siteexplorer.search.yahoo.com can output results in tsv format, when opened in excel I get 4 columns. I would like to wget that file, which I can do. I would then like to pull the 2nd column and output it only. I've searched around and found a few bits and pieces but nothing I've... (6 Replies)
Discussion started by: casphar
6 Replies

5. Shell Programming and Scripting

getting the column header in the output !

i have a script that access the database and then returns some row. but in the command prompt it it not showing the column header. how to get that ? below the script: ------------------------------------------------------------------------ #!/bin/ksh .... (4 Replies)
Discussion started by: ali560045
4 Replies

6. Shell Programming and Scripting

top output for six processes with the same name, output changed from column to row

Hi, I have a system under test, and I use a script that does a ps. The output, is in the following format, it's basically the timestamp, followed by the rss and vsize. 09:03:57 68404 183656 68312 181944 69860 217360 67536 182564 69072 183172 69032 199276 09:04:27 68752 183292 70000 189020... (5 Replies)
Discussion started by: Bloke
5 Replies

7. Shell Programming and Scripting

Converting line output to column based output

Hi Guys, I am trying to convert a file which has a row based output to a column based output. My original file looks like this: 1 2 3 4 5 6 1 2 3 1 2 3 (8 Replies)
Discussion started by: npatwardhan
8 Replies

8. Shell Programming and Scripting

Column to row output

Hello All, i have a file with the contents like shown below Name = POLICY1 Selected = 1 Written = 0 Name = POLICY2 Selected = 6 Written = 8 Name = POLICY3 Selected = 4 Written = 26 I want the output to be... (5 Replies)
Discussion started by: vinredmac
5 Replies

9. Shell Programming and Scripting

Column output

awk -v OFS="\t" -v ORS="\r\n" 'NR==FNR{A=$4; next} A {$4=$4 " " A}1' refseq_genes.txt LCH_exons.txt > output2.txt Trying to output the data to separate columns in excel, but the 4th column seems to be merged together. This is more of just a learning question. Thank you :). (1 Reply)
Discussion started by: cmccabe
1 Replies

10. Shell Programming and Scripting

How to append the output in a new column?

input1 john 20 bob 30 input2 john 60 bob 100 cat input1 >> output cat input2 >> output ouput john 20 bob 30 john 60 bob 100 desired output input1 input1 input2 input2 john 20 john 60 (3 Replies)
Discussion started by: quincyjones
3 Replies
TCTMTTEST(1)							   Tokyo Cabinet						      TCTMTTEST(1)

NAME
tctmttest - test cases of the table database API DESCRIPTION
The command `tctmttest' is a utility for facility test under multi-thread situation. This command is used in the following format. `path' specifies the path of a database file. `tnum' specifies the number of running threads. `rnum' specifies the number of iterations. `bnum' specifies the number of buckets. `apow' specifies the power of the alignment. `fpow' specifies the power of the free block pool. tctmttest write [-tl] [-td|-tb|-tt|-tx] [-rc num] [-lc num] [-nc num] [-xm num] [-df num] [-ip] [-is] [-in] [-it] [-if] [-ix] [-nl|-nb] [-rnd] path tnum rnum [bnum [apow [fpow]]] Store records with columns "str", "num", "type", and "flag". tctmttest read [-rc num] [-lc num] [-nc num] [-xm num] [-df num] [-nl|-nb] [-rnd] path tnum Retrieve all records of the database above. tctmttest remove [-rc num] [-lc num] [-nc num] [-xm num] [-df num] [-nl|-nb] [-rnd] path tnum Remove all records of the database above. tctmttest wicked [-tl] [-td|-tb|-tt|-tx] [-nl|-nb] path tnum rnum Perform updating operations selected at random. tctmttest typical [-tl] [-td|-tb|-tt|-tx] [-rc num] [-lc num] [-nc num] [-xm num] [-df num] [-nl|-nb] [-rr num] path tnum rnum [bnum [apow [fpow]] Perform typical operations selected at random. Options feature the following. -tl : enable the option `TDBTLARGE'. -td : enable the option `TDBTDEFLATE'. -tb : enable the option `TDBTBZIP'. -tt : enable the option `TDBTTCBS'. -tx : enable the option `TDBTEXCODEC'. -rc num : specify the number of cached records. -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. -ip : create the number index for the primary key. -is : create the string index for the column "str". -in : create the number index for the column "num". -it : create the string index for the column "type". -if : create the token inverted index for the column "flag". -ix : create the q-gram inverted index for the column "text". -nl : enable the option `TDBNOLCK'. -nb : enable the option `TDBLCKNB'. -rnd : select keys at random. -nc : omit the comparison test. -rr num : specify the ratio of reading operation by percentage. This command returns 0 on success, another on failure. SEE ALSO
tcttest(1), tctmgr(1), tctdb(3), tokyocabinet(3) Man Page 2012-08-18 TCTMTTEST(1)
All times are GMT -4. The time now is 09:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy