10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello all,
I have a csv with with different testcase values in column 5.
year,min,max,Instrument,Testcase
2016,201,1003,GEOTROPH-02116,TATA7980
2016,53,1011,GEOTROPH-01963,TATA7980
2016,3,1024,GEOTROPH-02067,TATA7980
2016,203,1027,GEOTROPH-02011,TATA7980... (16 Replies)
Discussion started by: senhia83
16 Replies
2. Shell Programming and Scripting
Hi All,
Could anyoone please let me know how do I get sqlplus column header once in csv file
Scripts are below:
cat concreq.sh
#!/bin/bash
. $HOME/.profile
while ; do
sqlplus apps/pwd <<-EOF
set lines 100 pages 100
col "USER_CONCURRENT_QUEUE_NAME" format a40;
--set termout off... (5 Replies)
Discussion started by: a1_win
5 Replies
3. Shell Programming and Scripting
Hi,
I have an input like this
1 2 3 4
2 3 4 5
4 5 6 7
I would like to count the no. of columns and print a header with a prefix "Col".
I would also like to count the no. of rows and print as first column with each line number with a prefix "Row"
So, my output would be
... (2 Replies)
Discussion started by: jacobs.smith
2 Replies
4. UNIX for Dummies Questions & Answers
Hi! Is there a way to append column and row header to a file in awk script.
For example if I have
Jane F 39 manager
Carlos M 40 system administrator
Sam F 20 programmer
and I want it to be
# name gend age occup
1 Jane F 39 manager
2 Carlos M ... (4 Replies)
Discussion started by: FUTURE_EINSTEIN
4 Replies
5. Shell Programming and Scripting
Hi
I have in put file A.txt
ABCDE1 JFHFJFJF3 1 1 SC1 12/10
ABCDE2 JFHFJFJF5 1 1 SC1 12/10
ABCDE3 JFHFJFJF5 1 1 SC1 12/10
ABCDE4 JFHFJFJF6 1 1 SC1 12/10
I want output in .csv with header:
Name SUb_N x y No Board
ABCDE1 JFHFJFJF3 1 1 SC1 12/10
ABCDE2 JFHFJFJF5 1 1 SC1... (7 Replies)
Discussion started by: pareshkp
7 Replies
6. UNIX for Dummies Questions & Answers
Hi All,
I have a file example.csv which looks like this
GrpID,TargetID,Signal,Avg_Num
CSCH74_1_1,2007,61,256
CSCH74_1_1,212007,647,679
CSCH74_1_1,12007,3,32
CSCH74_1_1,207,299,777
I want the output as
GrpID,TragetID,Signal-CSCH74_1_1,Avg_Num
CSCH74_1_1,2007,61,256... (1 Reply)
Discussion started by: Vavad
1 Replies
7. Shell Programming and Scripting
Hi All,
I have a file example.csv which looks like this
GrpID,TargetID,Signal,Avg_Num
CSCH74_1_1,2007,61,256
CSCH74_1_1,212007,647,679
CSCH74_1_1,12007,3,32
CSCH74_1_1,207,299,777
I want the output as
GrpID,TragetID,Signal-CSCH74_1_1,Avg_Num
CSCH74_1_1,2007,61,256... (4 Replies)
Discussion started by: Vavad
4 Replies
8. Ubuntu
Hi;
I've been searching posts to find a solution to what I'm trying to do, but I've have NOT found anything yet.
I have a file (file1) with 300K columns and 1411 rows, the columns don't have a column no. header (No header at all) and I'm trying to fetch the information from specific columns.... (3 Replies)
Discussion started by: sogi
3 Replies
9. Shell Programming and Scripting
$ cat log.txt
Name Age Sex Lcation nfld alias xsd
CC 25 M XYZ asx KK Y
BB 21 F XAS awe SS N
SD 21 M AQW rty SD A
How can I replace the column with header "Lcation" with the column with header "alias" and delete the "alias" column?
so that the final output will become:
Name Age Sex... (10 Replies)
Discussion started by: jkl_jkl
10 Replies
10. Shell Programming and Scripting
Hi Gurus,
I have a requirement like this and have to create a UX shell scripts. Thanks in advance.
File-in:
------
Header2007-12-012007-11-21
100|xyz|was
101|wsa|qws
......
.......
Output should be:
-------------------
2007-12-01|100|xyz|was
2007-12-01|101|wsa|qws
......
.......... (7 Replies)
Discussion started by: vsubbu1000
7 Replies
RTBL(3) BSD Library Functions Manual RTBL(3)
NAME
rtbl_create, rtbl_destroy, rtbl_set_flags, rtbl_get_flags, rtbl_set_prefix, rtbl_set_separator, rtbl_set_column_prefix,
rtbl_set_column_affix_by_id, rtbl_add_column, rtbl_add_column_by_id, rtbl_add_column_entry, rtbl_add_column_entry_by_id, rtbl_new_row,
rtbl_format -- format data in simple tables
LIBRARY
The roken library (libroken, -lroken)
SYNOPSIS
#include <rtbl.h>
int
rtbl_add_column(rtbl_t table, const char *column_name, unsigned int flags);
int
rtbl_add_column_by_id(rtbl_t table, unsigned int column_id, const char *column_header, unsigned int flags);
int
rtbl_add_column_entry(rtbl_t table, const char *column_name, const char *cell_entry);
int
rtbl_add_column_entry_by_id(rtbl_t table, unsigned int column_id, const char *cell_entry);
rtbl_t
rtbl_create(void);
void
rtbl_destroy(rtbl_t table);
int
rtbl_new_row(rtbl_t table);
int
rtbl_set_column_affix_by_id(rtbl_t table, unsigned int column_id, const, char, *prefix", const char *suffix);
int
rtbl_set_column_prefix(rtbl_t table, const char *column_name, const char *prefix);
unsigned int
rtbl_get_flags(rtbl_t table);
void
rtbl_set_flags(rtbl_t table, unsigned int flags);
int
rtbl_set_prefix(rtbl_t table, const char *prefix);
int
rtbl_set_separator(rtbl_t table, const char *separator);
int
rtbl_format(rtbl_t table, FILE, *file");
DESCRIPTION
This set of functions assemble a simple table consisting of rows and columns, allowing it to be printed with certain options. Typical use
would be output from tools such as ls(1) or netstat(1), where you have a fixed number of columns, but don't know the column widths before
hand.
A table is created with rtbl_create() and destroyed with rtbl_destroy().
Global flags on the table are set with rtbl_set_flags and retrieved with rtbl_get_flags. At present the only defined flag is
RTBL_HEADER_STYLE_NONE which suppresses printing the header.
Before adding data to the table, one or more columns need to be created. This would normally be done with rtbl_add_column_by_id(), column_id
is any number of your choice (it's used only to identify columns), column_header is the header to print at the top of the column, and flags
are flags specific to this column. Currently the only defined flag is RTBL_ALIGN_RIGHT, aligning column entries to the right. Columns are
printed in the order they are added.
There's also a way to add columns by column name with rtbl_add_column(), but this is less flexible (you need unique header names), and is
considered deprecated.
To add data to a column you use rtbl_add_column_entry_by_id(), where the column_id is the same as when the column was added (adding data to a
non-existent column is undefined), and cell_entry is whatever string you wish to include in that cell. It should not include newlines. For
columns added with rtbl_add_column() you must use rtbl_add_column_entry() instead.
rtbl_new_row() fills all columns with blank entries until they all have the same number of rows.
Each column can have a separate prefix and suffix, set with rtbl_set_column_affix_by_id; rtbl_set_column_prefix allows setting the prefix
only by column name. In addition to this, columns may be separated by a string set with rtbl_set_separator (by default columns are not
seprated by anything).
The finished table is printed to file with rtbl_format.
EXAMPLES
This program:
#include <stdio.h>
#include <rtbl.h>
int
main(int argc, char **argv)
{
rtbl_t table;
table = rtbl_create();
rtbl_set_separator(table, " ");
rtbl_add_column_by_id(table, 0, "Column A", 0);
rtbl_add_column_by_id(table, 1, "Column B", RTBL_ALIGN_RIGHT);
rtbl_add_column_by_id(table, 2, "Column C", 0);
rtbl_add_column_entry_by_id(table, 0, "A-1");
rtbl_add_column_entry_by_id(table, 0, "A-2");
rtbl_add_column_entry_by_id(table, 0, "A-3");
rtbl_add_column_entry_by_id(table, 1, "B-1");
rtbl_add_column_entry_by_id(table, 2, "C-1");
rtbl_add_column_entry_by_id(table, 2, "C-2");
rtbl_add_column_entry_by_id(table, 1, "B-2");
rtbl_add_column_entry_by_id(table, 1, "B-3");
rtbl_add_column_entry_by_id(table, 2, "C-3");
rtbl_add_column_entry_by_id(table, 0, "A-4");
rtbl_new_row(table);
rtbl_add_column_entry_by_id(table, 1, "B-4");
rtbl_new_row(table);
rtbl_add_column_entry_by_id(table, 2, "C-4");
rtbl_new_row(table);
rtbl_format(table, stdout);
rtbl_destroy(table);
return 0;
}
will output the following:
Column A Column B Column C
A-1 B-1 C-1
A-2 B-2 C-2
A-3 B-3 C-3
A-4
B-4
C-4
HEIMDAL
June 26, 2004 HEIMDAL