Sponsored Content
Top Forums Shell Programming and Scripting sequential to line sequential Post 302492575 by vakharia Mahesh on Monday 31st of January 2011 10:53:27 PM
Old 01-31-2011
sequential to line sequential

Hi
I have a file sequential way i.e. written in contineous mode and the Record Seperator is AM from which the record is seperated .Now to process I have to make line sequential,and more over record length is not same it varies as per the input address,
Code:
AM1234563 John Murray 24 Old streeet old way Chicago AM451235 Lawrance Kaylep new roan ridge road kansas city AM87954 Ashly Woods kalgurah park lane  jersy city NJ AM96245 Linus Macanzeestreet river side lane Detroit AM753125 Thomas Alva Kopasli way  Las vagas

Output wanted in this format
Code:
AM1234563 John Murray 24 Old streeet old way Chicago 
AM451235 Lawrance Kaylep new roan ridge road kansas city 
AM87954 Ashly Woods kalgurah park lane  jersy city NJ
AM96245 Linus Macanzee street river side lane Detroit 
AM753125 Thomas Alva Kopasli way  Las vagas

Can anyone guide ??

Thanks in advance

Vakharia M J

Last edited by Scott; 02-01-2011 at 12:01 AM.. Reason: Code tags, please...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

running script sequential

I have 4 scripts I need to run sequentially(can't run simultaneously) What's the syntax for it? I am running Korn Shell. Thanks, (2 Replies)
Discussion started by: ocjunky
2 Replies

2. Programming

Reading special characters while converting sequential file to line sequential

We have to convert a sequential file to a 80 char line sequential file (HP UX platform).The sequential file contains special characters. which after conversion of the file to line sequential are getting coverted into "new line" or "tab" and file is getting distorted. Is there any way to read these... (2 Replies)
Discussion started by: Rajeshsu
2 Replies

3. Shell Programming and Scripting

sequential running for 2 scripts

Hello I have a script that has 2 scripts that must be executed one after the other. however, when I run the script, the 2 sub-scripts are run in parallel. any idea how to fix this without using sleep command? thank you (7 Replies)
Discussion started by: melanie_pfefer
7 Replies

4. Shell Programming and Scripting

Append specific lines to a previous line based on sequential search criteria

I'll try explain this as best I can. Let me know if it is not clear. I have large text files that contain data as such: 143593502 09-08-20 09:02:13 xxxxxxxxxxx xxxxxxxxxxx 09-08-20 09:02:11 N line 1 test line 2 test line 3 test 143593503 09-08-20 09:02:13... (3 Replies)
Discussion started by: jesse
3 Replies

5. Programming

Tool to simulate non-sequential disk I/O (simulate db file sequential read) in C POSIX

Writing a Tool to simulate non-sequential disk I/O (simulate db file sequential read) in C POSIX I have over the years come across the same issue a couple of times, and it normally is that the read speed on SAN is absolutely atrocious when doing non-sequential I/O to the disks. Problem being of... (7 Replies)
Discussion started by: vrghost
7 Replies

6. Shell Programming and Scripting

Sequential numbers

Hi All, I am looking for a simple way to write numbers to a file sequentially starting from 1 and ending on a specified upper limit. Example of the output file is below Example 1 2 3 4 5 . . . . 1000 please let me know the best way to do it. (10 Replies)
Discussion started by: Lucky Ali
10 Replies

7. Shell Programming and Scripting

Add markup tag and sequential number after specific line

Hello, This one has me a bit stumped. I have data the looks like, M END > <PREDICTION_ACCURACY> PROBABLE > <NO_OF_PARENTS> 3 > <CLOGP> -13.373 > <SMILES> OCC(O)C(OC1OC(CO)C(OC2OC(CO)C > <MIMW> 1006.322419888 (3 Replies)
Discussion started by: LMHmedchem
3 Replies

8. Shell Programming and Scripting

Sequential counting

Hi have a file of the following format a1 a1 a2 a2 a4 a4 a4 a3 a3 a5 a6 a6 a6 a6 .. 100's of lines (2 Replies)
Discussion started by: Lucky Ali
2 Replies

9. Shell Programming and Scripting

Inserting new line if two sequential lines begin with the same string

Hi I have a file like this: Peter North Mary Peter North Peter Borough Mary I need there to put 'X' (or anything) on a new line between the two lines where 'Peter' begins the line. There will be many matches to this string, but they will always begin with 'Peter'. Ie, the resulting... (2 Replies)
Discussion started by: majormajormajor
2 Replies

10. Shell Programming and Scripting

awk use sequential line numbering in output

The awk below produces an output with the original header and only the matching lines (which is good), but the output where the original line numbering in the match found on is used. I can not figure out how to sequentially number the output instead of using the original. I did try to add... (2 Replies)
Discussion started by: cmccabe
2 Replies
MAXDB_FETCH_ASSOC(3)							 1						      MAXDB_FETCH_ASSOC(3)

maxdb_fetch_assoc - Fetch a result row as an associative array

       Procedural style

SYNOPSIS
array maxdb_fetch_assoc (resource $result) DESCRIPTION
Object oriented style array maxdb_result::fetch_assoc (void ) Returns an associative array that corresponds to the fetched row or NULL if there are no more rows. The maxdb_fetch_assoc(3) function is used to return an associative array representing the next row in the result set for the result repre- sented by the $result parameter, where each key in the array represents the name of one of the result set's columns. If two or more columns of the result have the same field names, the last column will take precedence. To access the other column(s) of the same name, you either need to access the result with numeric indices by using maxdb_fetch_row(3) or add alias names. Note Field names returned by this function are case-sensitive. Note This function sets NULL fields to the PHP NULL value. RETURN VALUES
Returns an array that corresponds to the fetched row or NULL if there are no more rows in resultset. 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 name, state FROM hotel.city ORDER by zip"; if ($result = $maxdb->query($query)) { /* fetch associative array */ while ($row = $result->fetch_assoc()) { printf ("%s (%s) ", $row["NAME"], $row["STATE"]); } /* free result set */ $result->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 name, state FROM hotel.city ORDER by zip"; if ($result = maxdb_query($link, $query)) { /* fetch associative array */ while ($row = maxdb_fetch_assoc($result)) { printf ("%s (%s) ", $row["NAME"], $row["STATE"]); } /* free result set */ maxdb_free_result($result); } /* close connection */ maxdb_close($link); ?> The above example will output something similar to: New York (NY) New York (NY) Long Island (NY) Albany (NY) Washington (DC) Washington (DC) Washington (DC) Silver Spring (MD) Daytona Beach (FL) Deerfield Beach (FL) Clearwater (FL) Cincinnati (OH) Detroit (MI) Rosemont (IL) Chicago (IL) Chicago (IL) New Orleans (LA) Dallas (TX) Los Angeles (CA) Hollywood (CA) Long Beach (CA) Palm Springs (CA) Irvine (CA) Santa Clara (CA) Portland (OR) SEE ALSO
maxdb_fetch_array(3), maxdb_fetch_row(3), maxdb_fetch_resource(3). PHP Documentation Group MAXDB_FETCH_ASSOC(3)
All times are GMT -4. The time now is 10:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy