10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have two files, file1 and file2 who have identical number of rows and columns. However, the script is supposed to be used for for different files and I cannot know the format in advance. Also, the number of columns changes within the file, some rows have more and some less columns (they are... (13 Replies)
Discussion started by: maya3
Hi, I have 2 different values in the same column and two different values in other column
ins name value
1 Test 12345
1 TestV1 12/10/2014
8 Test 85435
8 TestV1 11/11/2005
9 Test 42232
9 TestV1 19/10/2000
6 Test 54321... (6 Replies)
Discussion started by: faka
3. Shell Programming and Scripting
Hi all, I know this sounds suspiciously like a homework course; but, it is not.
My goal is to take a file, and match my "ID" column to the "Date" column, if those conditions are true, add the total number of minutes worked and place it in this file, while not printing the original rows that I... (6 Replies)
Discussion started by: mtucker6784
4. UNIX for Dummies Questions & Answers
I have connected to oracle database with sqlplus -s / <<EOF
select ename, age from emp where empid=1234;
I want to save the values of ename and age in unix shell variables. Any pointers would be welcome..
Thanks in advance!!1
Cheers :):):):) (1 Reply)
Discussion started by: gonchusirsa
5. Shell Programming and Scripting
I have the following input file
chr1 100 200 0.1 0.2 na 1 na nd
chr1 105 200 0.1 0.2 1 1 na 98
chr1 110 290 nf 1 na nd na 1
chr2 130 150 12 3 na 1 na 1
chr3 450 600 nf nf na 10 na nd
chr4 300 330 1 1 10 11 23 34
My requirement is
1. If $6 is na make $7 nd and... (2 Replies)
Discussion started by: jacobs.smith
6. Shell Programming and Scripting
I am trying to selectively display several columns from a db2 query, which gives me a fixed-width output (partial output listed here):
--------- -------------------------- ------------ ------
000 0000000000198012 702 29
000 0000000000198013 ... (9 Replies)
Discussion started by: ahsh79
7. UNIX for Dummies Questions & Answers
This below script adds a column extra to my flat file..But how can i add another column, Say if i just put mention an other column beside the first column..it does get generated but as one column only
while IFS="" read r; do
printf "dummy\t%s\n" "$r"
done < xxx.txt > zzz.txt
... (9 Replies)
Discussion started by: saggiboy10
8. Shell Programming and Scripting
I have a huge file with a single line.
But I want to break that line into lines of with each line having five columns.
My file is like this:
I want it like this:
code:... (1 Reply)
Discussion started by: rajsharma
9. Shell Programming and Scripting
I have data extracted like this:
A=%123% B=%456% C=%789%
A=%111% B=%222% C=%333%
A=%777% B=%888% C=%999%
Can someone please help me with a script to remove all the % signs and get the totals for A, B and C.
So output will be:
Thank you! (2 Replies)
Discussion started by: tatchel
10. Shell Programming and Scripting
I need a script that will run a dynamic Oracle SQL. Dynamic meaning the SQL statement depends on the parameter.
For instance, something like this:
# Set environment
sqlplus $LOGINID <<! >> /home/mine/log.txt
select count(1) from $1
where... (2 Replies)
Discussion started by: laiko
isql(1) UnixODBC manual pages isql(1)
isql, iusql - unixODBC command-line interactive SQL tool
isql DSN [USER [PASSWORD]] [options]
isql is a command line tool which allows the user to execute SQL in batch or interactively. It has some interesting options such as an
option to generate output wrapped in an HTML table.
iusql is the same tool with built-in Unicode support.
DSN The Data Source Name, which should be used to make connection to the database. The data source is looked for in the /etc/odbc.ini
and $HOME/.odbc.ini files in that order, with the latter overwriting the former.
USER Specifies the database user/role under which the connection should be made.
Password for the specified USER.
-b Run isql in non-interactive batch mode. In this mode, the isql processes its standard input, expecting one SQL command per line.
Delimits columns with delimiter.
-xHEX Delimits columns with HEX, which is a hexadecimal code of the delimiting character in the format 0xNN - i.e. 0x09 for the TAB char-
-w Format the result as HTML table.
-c Output the names of the columns on the first row. Has any effect only with the -d or -x options.
-mNUM Limit the column display width to NUM characters.
Sets locale to LOCALE.
-q Wrap the character fields in double quotes.
-3 Use the ODBC 3 calls.
-n Use the newline processing.
-e Use the SQLExecDirect instead of Prepare.
-k Use SQLDriverConnect.
-v Turn on the verbose mode, where the errors are fully described. Useful for debugging.
Prints the program version and exits.
This section briefly describes some isql runtime commands.
List all tables in the database.
List all columns in the table.
List all help options.
$ isql WebDB MyID MyPWD -w -b < My.sql
Connects to the WebDB as user MyID with password MyPWD, then execute the commands in the My.sql file and returns the results wrapped in
HTML table. Each line in My.sql must contain exactly 1 SQL command, except for the last line, which must be blank (unless the -n option is
System-wide DSN definitions. See odbc.ini(5) for details.
User-specific DSN definitions. See odbc.ini(5) for details.
The authors of unixODBC are Peter Harvey <email@example.com> and Nick Gorham <firstname.lastname@example.org>. For the full list of contributors
see the AUTHORS file.
unixODBC is licensed under the GNU Lesser General Public License. For details about the license, see the COPYING file.
version 2.3.1 Tue 25 Jun 2013 isql(1)