Sponsored Content
Top Forums Shell Programming and Scripting Remove duplicates and update last 2 digits of the original row with 0's Post 302656395 by farawaydsky on Thursday 14th of June 2012 03:52:13 PM
Old 06-14-2012
Thank you....it works as expected
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Testing Var for 3 digits in a row only

Hi, I want to test a var, $inputPin to see if is 3 digits in a row or not in a Bash script. I am getting stuck on the regex to do this. And the equality test if it is in an if statement as below? -ne is for comparing numbers But I guess it would be != in this case if \{3,3\]}] ... (6 Replies)
Discussion started by: de_la_espada
6 Replies

2. Shell Programming and Scripting

remove row if string is same as previous row

I have data like: Blue Apple 6 Red Apple 7 Yellow Apple 8 Green Banana 2 Purple Banana 8 Orange Pear 11 What I want to do is if $2 in a row is the same as $2 in the previous row remove that row. An identical $2 may exist more than one time. So the out file would look like: Blue... (4 Replies)
Discussion started by: dcfargo
4 Replies

3. UNIX for Dummies Questions & Answers

CSV file:Find duplicates, save original and duplicate records in a new file

Hi Unix gurus, Maybe it is too much to ask for but please take a moment and help me out. A very humble request to you gurus. I'm new to Unix and I have started learning Unix. I have this project which is way to advanced for me. File format: CSV file File has four columns with no header... (8 Replies)
Discussion started by: arvindosu
8 Replies

4. Shell Programming and Scripting

remove directories with two digits after decimal point

Hi everyone, I am new here and generally not experienced with linux. My question must be easy, but as for now I have no idea how to do it. I have lots of directories with numerical names, e.g. 50 50.1 50.12 etc. What I want is to leave directories with no or single digit after the decimal... (2 Replies)
Discussion started by: cabaciucia
2 Replies

5. Shell Programming and Scripting

Identify duplicates and update the last 2 digits to 0 for both the Orig and Dup

Hi, I have a requirement where I have to identify duplicates from a file based on the first 6 chars (It is fixed width file of 12 chars length) and whenever a duplicate row is found, its original and duplicate row's last 2 chars should be updated to all 0's if they are not same. (I mean last 2... (3 Replies)
Discussion started by: farawaydsky
3 Replies

6. Shell Programming and Scripting

Remove all digits and rename a file

Hi, I have a file nexus-1234 in a directory. I want to generate a random number and replace the 1234 with it and rename the file. So nexus-1234 becomes nexus-2863 after running the script. Any help is appreciated. Thanks in advance. (2 Replies)
Discussion started by: scorpioraghu
2 Replies

7. Shell Programming and Scripting

Remove duplicates within row and separate column

Hi all I have following kind of input file ESR1 PA156 leflunomide PA450192 leflunomide CHST3 PA26503 docetaxel Pa4586; thalidomide Pa34958; decetaxel docetaxel docetaxel I want to remove duplicates and I want to separate anything before and after PAxxxx entry into columns or... (1 Reply)
Discussion started by: manigrover
1 Replies

8. Shell Programming and Scripting

Need to print duplicate row along with highest version of original

There are some duplicate field on description column .I want to print duplicate row along with highest version of number and corresponding description column. file1.txt number Description === ============ 34567 nl21a00is-centerdb001:ncdbareq:Error in loading init 34577 ... (7 Replies)
Discussion started by: vijay_rajni
7 Replies

9. Shell Programming and Scripting

Trying to remove duplicates based on field and row

I am trying to see if I can use awk to remove duplicates from a file. This is the file: -==> Listvol <== deleting /vol/eng_rmd_0941 deleting /vol/eng_rmd_0943 deleting /vol/eng_rmd_0943 deleting /vol/eng_rmd_1006 deleting /vol/eng_rmd_1012 rearrange /vol/eng_rmd_0943 ... (6 Replies)
Discussion started by: newbie2010
6 Replies

10. Shell Programming and Scripting

Splitting single row into multiple rows based on for every 10 digits of last field of the row

Hi ALL, We have requirement in a file, i have multiple rows. Example below: Input file rows 01,1,102319,0,0,70,26,U,1,331,000000113200000011920000001212 01,1,102319,0,1,80,20,U,1,241,00000059420000006021 I need my output file should be as mentioned below. Last field should split for... (4 Replies)
Discussion started by: kotra
4 Replies
FBSQL_DATA_SEEK(3)							 1							FBSQL_DATA_SEEK(3)

fbsql_data_seek - Move internal result pointer

SYNOPSIS
bool fbsql_data_seek (resource $result, int $row_number) DESCRIPTION
Moves the internal row pointer of the FrontBase result associated with the specified result identifier to point to the specified row num- ber. The next call to fbsql_fetch_row(3) would return that row. PARAMETERS
o $ result -A result identifier returned by fbsql_query(3) or fbsql_db_query(3). o $row_number - The row number. Starts at 0. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 fbsql_data_seek(3) example <?php $link = fbsql_pconnect("localhost", "_SYSTEM", "secret") or die("Could not connect"); fbsql_select_db("samp_db") or die("Could not select database"); $query = "SELECT last_name, first_name FROM friends;"; $result = fbsql_query($query) or die("Query failed"); // fetch rows in reverse order for ($i = fbsql_num_rows($result) - 1; $i >=0; $i--) { if (!fbsql_data_seek($result, $i)) { printf("Cannot seek to row %d ", $i); continue; } if (!($row = fbsql_fetch_object($result))) continue; echo $row->last_name . $row->first_name . "<br /> "; } fbsql_free_result($result); ?> PHP Documentation Group FBSQL_DATA_SEEK(3)
All times are GMT -4. The time now is 03:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy