Results 1 to 3 of 3

Thread: Reading lines

  1. #1

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    39

    Reading lines

    I have txt file like below with hundres of lines.
    ---------------------------------------------------------------------
    0070005003 8002 08287650859220101001000003Things That Love
    0070005004 8002 08287650859220101001000104131Lattimore, Kenny
    ...
    ...
    ......
    ...
    ...
    ...
    0070005004 8002 08287650859220101006000204272Jaz, Jamey
    ---------------------------------------------------------------------


    <?PHP
    $lines = glob("C:/zipunzip/unzip/track/*.trk");

    for($i=0;$i<sizeof($lines);$i++){

    $fp=fopen($lines[$i],"r+") or die("error opening");
    $file_content =fread($fp,filesize($lines[$i]));
    fclose($fp);

    $arrContent=explode("\n",$file_content);

    for($j=0;$j<sizeof($arrContent);$j++){
    $search_term=$arrContent[$j];

    $tagfield = '0070005003';
    $pos = strpos($search_term, $findme);

    if ($tags == false) {
    echo "</br>";
    echo "TagField: ".$tagfield=substr($search_term,0,10)."</br>";
    // echo "SupplierID". $supid = substr($search_term,10,4)."</br>";
    // echo "Barcode: ".$barcode = substr($search_term,15,13)."</br>";
    // echo "SetRN".$setrn = substr($search_term,28,4)."</br>";
    // echo "Title Refrence: ".$titleref = substr($search_term,32,7)."</br>";
    // echo "Set Type: ".$settype = substr($search_term,38,2)."</br>";
    // echo "Track Title: ".$tracktitle = substr($search_term,40,119)."</br>";
    } else {
    //echo "bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla ";
    //echo "bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla ";
    }

    }

    }
    ?>

    thanks in advance

    Ramesh chaudhary
    Last edited by RameshChaudhary; Aug 16th, 2006 at 01:07 AM.

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Reading lines

    Quote Originally Posted by RameshChaudhary
    I have txt file like below with hundres of lines.
    Is it old enough to start breeding yet?
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    39

    Re: Reading lines

    Quote Originally Posted by visualAd
    Is it old enough to start breeding yet?
    Hi

    It is not solved yet. I can read line from file. But i could not read lines according to their tags (tag i.e. everylines first 10 character). If the tag is '0070005003' then i want to read same line. Could anybody help me out.


    Ramesh chaudhary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width