Column query


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Column query
# 1  
Old 08-24-2009
Column query

Hi all,
I have a data in a script like this.
First coloumn Second coloumn Third Coloumn
A*****************C****************D
*****************B****************E


L****************M****************N
****************O****************P
****************Q****************R


I want the above data in the form as mentioned below
First coloumn Second Coloumn
A.B**************D
L.O**************P
L.Q**************R

"*"ARE ONLY USED FOR SEAPARATING THE COLOUMNS.
Like above i want the command for getting the data in the desired form as mentioned (Not just for these three but a generic command for the whole script).KIndly help asap i am in the mid of something crucial.
i hope now the code is somewhat comprehendable.
Thanks & Regards

Last edited by navjotmannan; 08-25-2009 at 03:46 AM.. Reason: improving
# 2  
Old 08-24-2009
You'll have to edit that post to include CODE tags or we can't see the formatting you are trying to achieve.

In the meantime, printf might do what you need.
# 3  
Old 08-25-2009
Hi guys plzz....reply i have modified the query.

Regards
Navjot
# 4  
Old 08-25-2009
Could not follow what logic is being used to get the desired output. It would help us if you explain the logic a bit...
# 5  
Old 08-25-2009
Seriously, just use CODE tags (ie [ C O D E ] stuff to type [/CODE] - without the spaces in [ c o d e ] though).
I'm also as confused as rakeshawasthi as to what logic is required here sorry Smilie

Take a bit of time, and try and spell it out very clearly what you are after, format it cleanly using the CODE tags (there's help on using them on the forum here), and you should find a much more helpful audience Smilie In the long run it always saves time to take a little longer on that first post as the final answer is much quicker to arrive.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

DB2 Query -Convert multi values from column to rows

Hi Team I am using DB2 artisan tool and struck to handle multi values present in columns that are comma(,) separated. I want to convert those column values in separate rows . For example : Column 1 Column2 Jan,Feb Hold,Sell,Buy Expected Result Column1 ... (3 Replies)
Discussion started by: Perlbaby
3 Replies

2. Shell Programming and Scripting

Assigning multiple column's value from Oracle query to multiple variables in UNIX

Hi All, I need to read values of 10 columns from oracle query and assign the same to 10 unix variables. The query will return only one record(row). I tried to append all these columns using a delimiter(;) in the select query and assign the same to a single variable(V) in unix. I thought I... (3 Replies)
Discussion started by: hkrishnan91
3 Replies

3. Programming

Query to SELECT only Column Names that Contain a Specific String?

Hey Guys, I'm using SQuirreL SQL v3.5 GUI to fetch some data that I need for something I'm working on. I'm also using the IBM Informix Driver (*Version 3.5) to connect to the Database. What I want to do, if it's even possible, is to show all COLUMNS if they contain the word "Email". So in... (2 Replies)
Discussion started by: mrm5102
2 Replies

4. Shell Programming and Scripting

Difference of the same column when two other column matches and one column differs less than 1 hour

This is my input file : # cat list 20130430121600, cucm, location,76,2 20130430121600,cucm1,location1,76,4 20130430122000,cucm,location,80,8 20130430122000,cucm1,location1,90,8 20130430140000,cucm1,location1,87,11 20130430140000, cucm,location,67,9 This is the required output ... (1 Reply)
Discussion started by: Lakshmikumari
1 Replies

5. Shell Programming and Scripting

Shell Script to execute Oracle query taking input from a file to form query

Hi, I need to query Oracle database for 100 users. I have these 100 users in a file. I need a shell script which would read this User file (one user at a time) & query database. For instance: USER CITY --------- ---------- A CITY_A B CITY_B C ... (2 Replies)
Discussion started by: DevendraG
2 Replies

6. Shell Programming and Scripting

Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2

Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2 file 1 sample SNDK 80004C101 AT XLNX 983919101 BB NETL 64118B100 BS AMD 007903107 CC KLAC 482480100 DC TER 880770102 KATS ATHR 04743P108 KATS... (7 Replies)
Discussion started by: rydz00
7 Replies

7. Shell Programming and Scripting

Query Oracle tables and return values to shell script that calls the query

Hi, I have a requirement as below which needs to be done viz UNIX shell script (1) I have to connect to an Oracle database (2) Exexute "SELECT field_status from table 1" query on one of the tables. (3) Based on the result that I get from point (2), I have to update another table in the... (6 Replies)
Discussion started by: balaeswari
6 Replies

8. Shell Programming and Scripting

Changing one column of delimited file column to fixed width column

Hi, Iam new to unix. I have one input file . Input file : ID1~Name1~Place1 ID2~Name2~Place2 ID3~Name3~Place3 I need output such that only first column should change to fixed width column of 15 characters of length. Output File: ID1<<12 spaces>>Name1~Place1 ID2<<12... (5 Replies)
Discussion started by: manneni prakash
5 Replies

9. Shell Programming and Scripting

add the output of a query to a variable to be used in another query

I would like to use the result of a query in another query. How do I redirect/add the output to another variable? $result = odbc_exec($connect, $query); while ($row = odbc_fetch_array($result)) { echo $row,"\n"; } odbc_close($connect); ?> This will output hostnames: host1... (0 Replies)
Discussion started by: hazno
0 Replies

10. Shell Programming and Scripting

First Script: Query every table with column xxx.

Hi all, Im new to scripting and have no idea how to start this. Recently I had to Query an Oracle database to find a count(distinct version) from every single table inside. I want to write this up into a script for the future. I have a template to connect to the database, so that is not the... (1 Reply)
Discussion started by: Iniquity
1 Replies
Login or Register to Ask a Question