Sponsored Content
Top Forums Shell Programming and Scripting Populating File data with custom manipulation on file names Post 302746351 by Arun Mishra on Wednesday 19th of December 2012 07:35:25 AM
Old 12-19-2012
Hi, Thanks very much for your patience to read the thread and answring that.
but your code didnt gave appropriate output. See the output below:

HTML Code:
Terr|TerrName|Dist|DistName|REGION|RgnName|BCName|OFS=|
A0019473|Abington|PA|1|A0013142|Langhorne|PA|A0013261|Philadelphia|PA|PROGRESSIVE|OFS=|
A0019476|Albany|GA|1|A0013068|Albany|GA|A0013251|Jacksonville|FL|TRADITIONAL|OFS=|
A0019482|Albuquerque|S|NM|1|A0013070|Albuquerque|NM|A0013262|Phoenix|AZ|COST|CONTAINMENT|OFS=|
A0019485|Alexandria|VA|1|A0013229|Washington|DC|A0013273|Washington|DC|EMERGING|QUALITY|OFS=|
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

UNIX - File/Table/Data manipulation

Hi, I have a table (e.g.): a 1 e 4 5 6 b 2 r 4 4 2 c 5 r 3 7 1 d 9 t 4 4 9 . . What I need to do is to set the values of some values in column 2 to negative values. For example, the values 2 and 9 should become -2 and -9 in the modified file. How should I go about... (2 Replies)
Discussion started by: pc2001
2 Replies

2. Shell Programming and Scripting

Data manipulation from one file

HI all i have a file consisting of following numbers 0000 0000 0000 0000 0000 1010 0000 0100 0000 0000 0000 1111 0000 1010 0000 0100 (3 Replies)
Discussion started by: vaibhavkorde
3 Replies

3. Shell Programming and Scripting

Data manipulation from a file

i have a file in follwing format 0110 1020 1011 1032 1020 2005 2003 1050 i want the output in such a way that all non zero numbers will be converted into 1 like this 0110 1010 1011 1011 1010 1001 1001 1010 (3 Replies)
Discussion started by: vaibhavkorde
3 Replies

4. UNIX for Dummies Questions & Answers

Data file manipulation

Hi, I have two, double column data files (file1 and file2). I want to add the second column of file2 to as 3rd column of file1. But, the 3rd column values corresponds to the values of the 2nd column. example: file1: X Y ========= x1 y2 x3 y4 x2 y4 x5 y3 ========= file2: Y ... (7 Replies)
Discussion started by: gaurab
7 Replies

5. Shell Programming and Scripting

How to split a data file into separate files with the file names depending upon a column's value?

Hi, I have a data file xyz.dat similar to the one given below, 2345|98|809||x|969|0 2345|98|809||y|0|537 2345|97|809||x|544|0 2345|97|809||y|0|651 9685|98|809||x|321|0 9685|98|809||y|0|357 9685|98|709||x|687|0 9685|98|709||y|0|234 2315|98|809||x|564|0 2315|98|809||y|0|537... (2 Replies)
Discussion started by: nithins007
2 Replies

6. Shell Programming and Scripting

Manipulation of file data with UNIX

Hello , How all doing today.. I have a little doubt in Unix (6 Replies)
Discussion started by: adisky123
6 Replies

7. UNIX for Dummies Questions & Answers

Split a file and give custom names

Hello, I want to split a file based on an input list file that contains the lines each split should have + a corresponding file name. #!/bin/sh # sed -n 'start_line_#,end_line_#p' my_input_file > lines_extracted_output_file while read a b c do sed -n '$a,$bp' myLarge.file > $c.split... (2 Replies)
Discussion started by: Gussifinknottle
2 Replies

8. Shell Programming and Scripting

Data Manipulation on a .csv file

Hallo Friends, I need you help. My file has 5000 or so lines and currently looks like below(sample). Service Type,Origin,Destination,Rate Per Minute,Minimum Charge,Time Based Rate,Time Based From Day,Time Based To Day,Time Based From Time,Time Based To Time,Destination Prefix List,, VoIS... (3 Replies)
Discussion started by: kekanap
3 Replies

9. Shell Programming and Scripting

Exclude certain file names while selectingData files coming in different names in a file name called

Data files coming in different names in a file name called process.txt. 1. shipments_yyyymmdd.gz 2 Order_yyyymmdd.gz 3. Invoice_yyyymmdd.gz 4. globalorder_yyyymmdd.gz The process needs to discard all the below files and only process two of the 4 file names available ... (1 Reply)
Discussion started by: dsravanam
1 Replies

10. Shell Programming and Scripting

Sort file data according to a custom list of string

I have a string of pre defined ip address list which will always remain constant their order will never change like in below sample: iplist=8.8.5.19,9.7.5.14,12.9.9.23,8.8.8.14,144.1.113 In the above example i m considering only 5 ips but there could be many more. Now i have a file which... (15 Replies)
Discussion started by: mohtashims
15 Replies
MAXDB_STMT_FETCH(3)							 1						       MAXDB_STMT_FETCH(3)

maxdb_stmt_fetch - Fetch results from a prepared statement into the bound variables

       Procedural style

SYNOPSIS
bool maxdb_stmt_fetch (resource $stmt) DESCRIPTION
Object oriented style bool maxdb_stmt::fetch (void ) maxdb_stmt_fetch(3) returns row data using the variables bound by maxdb_stmt_bind_result(3). Note Note that all columns must be bound by the application before calling maxdb_stmt_fetch(3). RETURN VALUES
Return values +------+--------------------------------+ |Value | | | | | | | Description | | | | +------+--------------------------------+ | | | |TRUE | | | | | | | Success. Data has been fetched | | | | | | | |FALSE | | | | | | | Error occurred | | | | | | | |NULL | | | | | | | No more rows/data exists | | | | +------+--------------------------------+ EXAMPLES
Example #1 Object oriented style <?php $maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { printf("Connect failed: %s ", maxdb_connect_error()); exit(); } $query = "SELECT zip, name FROM hotel.city ORDER by name"; if ($stmt = $maxdb->prepare($query)) { /* execute statement */ $stmt->execute(); /* bind result variables */ $stmt->bind_result($name, $code); /* fetch values */ while ($stmt->fetch()) { printf ("%s (%s) ", $name, $code); } /* close statement */ $stmt->close(); } /* close connection */ $maxdb->close(); ?> Example #2 Procedural style <?php $link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { printf("Connect failed: %s ", maxdb_connect_error()); exit(); } $query = "SELECT zip, name FROM hotel.city ORDER by name"; if ($stmt = maxdb_prepare($link, $query)) { /* execute statement */ maxdb_stmt_execute($stmt); /* bind result variables */ maxdb_stmt_bind_result($stmt, $name, $code); /* fetch values */ while (maxdb_stmt_fetch($stmt)) { printf ("%s (%s) ", $name, $code); } /* close statement */ maxdb_stmt_close($stmt); } /* close connection */ maxdb_close($link); ?> The above example will output something similar to: 12203 (Albany) 60601 (Chicago) 60615 (Chicago) 45211 (Cincinnati) 33575 (Clearwater) 75243 (Dallas) 32018 (Daytona Beach) 33441 (Deerfield Beach) 48226 (Detroit) 90029 (Hollywood) 92714 (Irvine) 90804 (Long Beach) 11788 (Long Island) 90018 (Los Angeles) 70112 (New Orleans) 10019 (New York) 10580 (New York) 92262 (Palm Springs) 97213 (Portland) 60018 (Rosemont) 95054 (Santa Clara) 20903 (Silver Spring) 20005 (Washington) 20019 (Washington) 20037 (Washington) SEE ALSO
maxdb_prepare(3), maxdb_stmt_errno(3), maxdb_stmt_error(3), maxdb_stmt_bind_result(3). PHP Documentation Group MAXDB_STMT_FETCH(3)
All times are GMT -4. The time now is 10:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy