Sponsored Content
Top Forums Shell Programming and Scripting how to flip values of two columns and add an extra column Post 302248271 by zaxxon on Friday 17th of October 2008 08:11:46 AM
Old 10-17-2008
On what criteria is row 2 spared out of it?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to check Null values in a file column by column if columns are Not NULLs

Hi All, I have a table with 10 columns. Some columns(2nd,4th,5th,7th,8th and 10th) are Not Null columns. I'll get a tab-delimited file and want to check col by col and generate seperate error code for each col eg:102 if 2nd col value is NULL and 104 if 4th col value is NULL so on... I am a... (7 Replies)
Discussion started by: Mandab
7 Replies

2. UNIX for Dummies Questions & Answers

Add extra columns help

Hi Gurus, 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
9 Replies

3. Shell Programming and Scripting

Selecting lowest and highest values in columns 1 and 2, based on subsets in column 3

Hi, I have a file with the following columns: 361459 447394 CHL1 290282 290282 CHL1 361459 447394 CHL1 361459 447394 CHL1 178352861 178363529 AGA 178352861 178363529 AGA 178363657 178363657 AGA Essentially, using CHL1 as an example. For any line that has CHL1 in... (2 Replies)
Discussion started by: hubleo
2 Replies

4. Shell Programming and Scripting

Average of columns with values of other column with same name

I have a lot of input files that have the following form: Sample Cq Sample Cq Sample Cq Sample Cq Sample Cq 1WBIN 23.45 1WBIN 23.45 1CVSIN 23.96 1CVSIN 23.14 S1 31.37 1WBIN 23.53 1WBIN 23.53 1CVSIN 23.81 1CVSIN 23.24 S1 31.49 1WBIN 24.55 1WBIN 24.55 1CVSIN 23.86 1CVSIN 23.24 S1 31.74 ... (3 Replies)
Discussion started by: isildur1234
3 Replies

5. Shell Programming and Scripting

Add the values in second and third columns with group by on first column.

Hi All, I have a pipe seperated file. I need to add the values in second and third columns with group by on first column. MYFILE_28012012_1115|47|173.90 MYFILE_28012012_1115|4|0.00 MYFILE_28012012_1115|6|22.20 MYFILE_28012012_1116|47|173.90 MYFILE_28012012_1116|4|0.00... (3 Replies)
Discussion started by: angshuman
3 Replies

6. Shell Programming and Scripting

Add extra column if no column are less

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 File A.txt 11 LAL01A_1 1213 12 0 0 7 30 2 -122 1 300 14854 5000 2 221 LAL01A_1 1313 14 0 0 7 30 1 -122 2 300 14854 5000 2 12 LAL01A_1 1234 15 0 0 7 30 0 -122 1 300 14854 5000 2 I have file A.txt now i want to use if condition : if thr... (3 Replies)
Discussion started by: pareshkp
3 Replies

7. Linux

To get all the columns in a CSV file based on unique values of particular column

cat sample.csv ID,Name,no 1,AAA,1 2,BBB,1 3,AAA,1 4,BBB,1 cut -d',' -f2 sample.csv | sort | uniq this gives only the 2nd column values Name AAA BBB How to I get all the columns of CSV along with this? (1 Reply)
Discussion started by: sanvel
1 Replies

8. Shell Programming and Scripting

Splitting the numeric vs alpha values in a column to distinct columns

How could i take an input file and split the numeric values from the alpha values (123 vs abc) to distinc columns, and if the source is blank to keep it blank (null) in both of the new columns: So if the source file had a column like: Value: |1 | |2.3| | | |No| I would... (7 Replies)
Discussion started by: driftlogic
7 Replies

9. Shell Programming and Scripting

Request: How to Parse dynamic SQL query to pad extra columns to match the fixed number of columns

Hello All, I have a requirement in which i will be given a sql query as input in a file with dynamic number of columns. For example some times i will get 5 columns, some times 8 columns etc up to 20 columns. So my requirement is to generate a output query which will have 20 columns all the... (7 Replies)
Discussion started by: vikas_trl
7 Replies

10. UNIX for Beginners Questions & Answers

Copy columns from one file into another and get sum of column values and row count

I have a file abc.csv, from which I need column 24(PurchaseOrder_TotalCost) to get the sum_of_amounts with date and row count into another file say output.csv abc.csv- UTF-8,,,,,,,,,,,,,,,,,,,,,,,,, ... (6 Replies)
Discussion started by: Tahir_M
6 Replies
ODBC_FETCH_ROW(3)							 1							 ODBC_FETCH_ROW(3)

odbc_fetch_row - Fetch a row

SYNOPSIS
bool odbc_fetch_row (resource $result_id, [int $row_number]) DESCRIPTION
Fetches a row of the data that was returned by odbc_do(3) or odbc_exec(3). After odbc_fetch_row(3) is called, the fields of that row can be accessed with odbc_result(3). PARAMETERS
o $result_id - The result identifier. o $row_number - If $row_number is not specified, odbc_fetch_row(3) will try to fetch the next row in the result set. Calls to odbc_fetch_row(3) with and without $row_number can be mixed. To step through the result more than once, you can call odbc_fetch_row(3) with $row_number 1, and then continue doing odbc_fetch_row(3) without $row_number to review the result. If a driver doesn't support fetching rows by number, the $row_number parameter is ignored. RETURN VALUES
Returns TRUE if there was a row, FALSE otherwise. PHP Documentation Group ODBC_FETCH_ROW(3)
All times are GMT -4. The time now is 06:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy