Reading a copy 'end-of-file' marker using TEXT_IO

Hi
I am using TEXT_IO to read a file, but the in the file there are special characters such as
,' ' which I think are "end of file marker" 1A hex, which 'COPY' adds to the end of and ascii copy.
I'm using Oracle forms 6i, and when reading the above characters it raises unhandled exception ORA-01403, even though it hasn't reached the end of file.
Can anyone help or advaise a way to avoid this problem?
Thank You & Regards
Begum

One method is to save your data using the "write to spreadsheet file" vi, using whatever delimiter you choose (usually either comma ro tab char). This gives a file that can be opened with a text editor or Excel, and consists of rows of "numbers" seperated by the delimiter with an end of line char at the end of each row. When read back in using the "Read from Spreadsheet file", you can define how the values will be interpreted, either as numbers or as characters. The read data will be returned as a 2D array. This array can be indexed, either by autoindexing with loops, or by explicitly indexing to retrieve specific values (A[2,7]) and the returned values used however you wish.
P.M.
Putnam
Certified LabVIEW Developer
Senior Test Engineer
Currently using LV 6.1-LabVIEW 2012, RT8.5
LabVIEW Champion

Similar Messages

  • Regarding reading the data from the files without using Stremas

    hai to all of u...
    here i have a problem where i have to read the data from the files without using any streams.
    please guide me how to do this one,if possible by giving with an example
    Thanks & Regard
    M.Ramakrishna

    Simply put, you can't.
    By why do you need to?

  • End of file error using modified version Cont Pattern Input.

    Hi. I am using the Cont Pattern Input example, which is modified to write the Data Read to a file on the hard drive. A wire is connected from the Data Read to a "Write to I16 subVI" which is also modified to be a "Write to U8 subVI". It writes problem free to the file specified until the 2.1 GB when it displays a Error 4 "End of File Error". There is ample space on the hard drive. How do we get rid of this error as we would eventually need to write up to 60 GB of data?

    Unfortunately, the only thing to do is get a different operating system. I seem to recall that Windows has a fixed limit on file size of about 2G.
    Is there any way you can logically break the data you're collecting into smaller logical units? Alternately, you could structure your code to write to one file till it fills and automatically switch to a second, and a third and so on. As long as the routine that you write for working with these huge datasets keeps track of the various pieces of data it could all work as though it were all in one very very very large file.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Blank Lines at end of file when using Variable Substitution in File Adapter

    Hi all,
    I'm using variable substitution in a File Adapter, it's refers an element of message, like:
    filename    payload:MESSAGE_INTERFACE,1,FILENAME,1
    The variable substitution is working right, but it's append a BLANK LINE at end of file.
    Anyone knows how to solve this problem ?
    Thanks in advance.

    Hi Regis,
    I suppose you're using content conversion?
    if so try adding
    <b>endSeparator</b> = '0'
    to your last element
    this will delete the default line break at the end
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>

  • Solve: IOERROR: reading message: unexpected end of file

    Well, actually, maybe I should not put "solved" but "worked around".
    In my case, I had just installed my server. It is a Quad G5 and I had to do a hard time installing it because my DVD was 10.4 and would not boot in the G5. I've posted the process I used here:
    http://macosx.com/forums/showthread.php?t=267517
    Since it was a new install, I finally just stopped Mail services. Rebooted. Then I removed /var/imap and /var/spool/imap. Did a mkdir of those two directories. Change the owner/group to cyrusimap/mail. And then did:
    sudo -u cyrusimap /usr/bin/cyrus/tools/mkimap
    Before I did this, I went into my mail client (Mail on the client computer) and emptied and deleted everything on the imap server. I even deleted the mail account from within the Mail client. There seems to be some confusion over the cache maybe.
    Oh... I also deselected all my users from receiving mail. Rebooted a few times... held up a dead black cat... chanted quietly. Did the mkimap, and finally got all my 'end of file' problems to go away. I had to keep doing it a few times before I got the whole sequence right. Under no circumstances should you chant quietly before holding up the black cat... boy is that a bummer to fix.
    In short, I find postfix and cyrus to be extremely poorly designed (or maybe its just the Apple implementation of it). Pretty soon, we will be like running Windows...

    Check your scratch disks for fragmentation ( use something like disk warrior ) and available space.  Sounds like the files are not getting completely saved.

  • Reading the contents of a File without using the  fileref

    Hi ,
    I was trying to read the contents of a file (not upload
    basically) without using the fileref.upload or any servlets.
    I wanted to give this file as input(dataprovider) to a
    datagrid from the local instead of uploading it to the server and
    fetching the contents from there.
    I will explain the scenerio here:
    1.I have a text field. (Here I am providing the path of the
    file located).
    2.There is a Submit button .(On click should be able to take
    the specified file as input and read the contents of the file)
    which should be able to read the contents of the file path
    specified in step1.
    I want to basically provide the contents of this xml file as
    data provider to a datagrid.
    can anyone please provide some help on this issue.
    thanks

    You cannot access the local file system in Flex. You need to
    upload the file to the server, and then populate the file from that
    uploaded file. Unless of course you are using AIR, then this is
    doable.

  • SAXParseException: premature end of file in creating WARs

    Hi,
    I stronlgy follow the hints provided in J2EE tutorial to create some WARs from sample code,
    all is OK with compiling, however when I save my work (where ir is required in text), I get the following
    message
    ....WAR is corrupt or cannot be read
    SAXParseExcpetion: Premature end of file
    Where is cause for this? Additionally - when I try to install provided wars, all is OK (resp. I think that my installation work - J2EE 1.4 beta 2)
    Well during creating wars there is some reports about some bug which prevents to write URL directly during creation of war - could the cause be hidden here?
    Thanks for replies

    but I feel that .xml files should be correct - I try
    build samples and I get this error both for web
    applications and web service applications.Doesn't matter what you feel or assume. Are they correct or aren't they? The web and SOAP servers seem to think something's wrong. You ought to be checking all the XML that they touch to find out what's bothering them.
    I can't say that I know, but if you're getting a SAX parse exception an invalid web.xml will do it. They've got to be valid against the DTD for the web.xml. Have you verified your web.xml against the DTD? Will a browser or an app like XML Spy validate it for you?
    If you've checked it and found that it's okay, then I'm incorrect and you need to look at something else. But "feeling" that they're right isn't the same thing as being 100% certain because you've had a tool validate it against the DTD.

  • Upload file in to file system using Apex

    Hi...
    I have tried UTL_FILE to upload file in Directory. But First i have to upload file in Table in BLOB datatype and then copy it to file system using BFILE.
    I have to store files in file system as per requirements.
    I want to upload file directly to File System. Suggest me the right way...
    Thank You in advance........
    Edited by: user639262 on Aug 28, 2008 2:11 PM

    Apex only supports upload into a table.
    If you want to upload directly to the file system you should look into the possibilities of your application server. Maybe you could find a piece of code in Java or PHP that performs an upload.
    good luck, DickDral

  • I can't copy and paste files in finder arrrgghh

    Ok im not the most tech savvy person around and this is my first imac, I dont operate windows on it and am stumped. I am trying to transfer my movies onto a media player and external hard drive but it just wont do it. when I just had my previous pc all I had to do was copy and paste and am ready to scream. Does anyone have any answers????

    I don't think this is necessarily a disk format problem.  I've been noticing the same thing the past few weeks.  I used to copy and paste files frequently using the Finder but it no longer works.  I have the Copy option in the contextual menu when a file is selected but I no longer have a Paste option after doing the copy.
    All mounted drives on my system are formatted Mac OS Extended and the operation fails even when attempting to copy files residing on the boot drive to another folder on the same boot drive.  Digging around for a cause/solution now.
    UPDATE:
    The problem in my case was an application called Clipboard Cleaner that strips all formatting from text you copy to the clipboard so you can copy from something like a Word doc and paste into an email without all the Word formatting coming along as well.  It runs in the background and apparently disables the ability to copy/paste files.
    Message was edited by: jdubfromtx

  • Keep getting message pop up "Error reading/writing file  "com.apple.logic.pro.cs": Logical end-of-file reached during read operation," and "The Preferences are not loaded completely. Save them to "com.apple.logic.pro.cs" anyway?" Using Logic pro 8. ???

    Logic froze while I was working on something so I forced quit.  Now every time I open LOGIC a message pops up that says:
    "Error reading/writing file
    “com.apple.logic.pro.cs”:
    Logical end-of-file reached during read operation."
    The only button option is cancel so I press it and another message appears that says:
    "The Preferences are not loaded completely.
    Do not save them, as you would overwrite the Preferences file with incomplete data."
    Then when i close logic a box appears saying:
    "The Preferences are not loaded completely.
    Save them to "com.apple.logic.pro.cs" anyway?"
    There are 3 button options to press; ok, cancel or dont save.
    I press "don’t save" cuz I don't want to ruin anything.
    I found a discussion located here: https://discussions.apple.com/message/9564253#9564253 that says if I delete the file "com.apple.logic.pro.cs" it will resolve the problem.  If I do this will I loose or mess anything up at all, automation, saved channel strips customizations, saved effects, synth, or ultrabeat customizations etc? Or especially will I loose any work I've done?  I have hundreds pieces of music files I've created.  I'm scared to mess anything up with all the hours and months of work I've done.  Is there anyway to fix this without loosing anything?  I'm using Logic Pro 8.
    Thank you

    You can safely delete this file - its the preference file for control surface settings - you haven't said whether you're actually using a control surface or not, if so, you will have to set it up again. A new file will be created when you fire Logic up again, but of course it will contain default settings. If you have a complicated control surface setup, remember to keep a backup copy somewhere in case any future problems arise.
    Other than that, you really have nothing to be scared about - hopefully your problem is as simple as that and there isn't an underlying problem (a corrupt hard drive, for example). You seem concerned about losing work, so I guess you want to think about backing that up on a regular basis too. If you're saving your projects to your system drive, do get an external one for this. And also check that you have plent of free space on your system drive - you need to keep about a quarter or third of it free for your OS and programs to run properly (some temporarily stored files can be quite large).

  • Which version of Reader 9 (if any) has the End of File button?

    I sell CDs containing over 100 linked pdf files created in InDesign 4. The CDs also contain version 6 of Reader for navigating the bookmarks and links in the pdf files. The disc contains a Tutorial.pdf file with navigation instructions. These refer to the navigation buttons visible in Reader 6 and make extensive use of the End of File button (green with a white left pointing arrow) as a quick means of getting back to the Start file which is the portal to all the others.. Some owners who have Reader 9 installed say that the End of File button is not displayed on their screen. This has come from owners using XP, Vista and Win 7. Is there a version of Reader 9 for Windows that retains this button, please?

    What you are referring to is the First Page and Last Page buttons:  "|<"   and ">|" respectively.  These can be found by right-clicking on an empty part of the File toolbar and navigating to "Page Navigation Toolbar" in the More Tools pop-up-window.  They are not check-marked by default which is why they don't display.  The user can turn them on by placing a checkmark next to those icons in the pop-up window for "More Tools"

  • File in use error - copying from a faulty external hard drive

    Hi,
    I have a 750GB Western Digital external hard drive, which contains two partitions - (1) HDBACKUP - a Time Machine backup of my laptop drive, and (2) MEDIA - pictures including an Aperture library, and videos.
    When I plug the drive in, only the MEDIA partition mounts. And I get an error saying Disk Utility cannot repair the drive and to backup the files as soon as I can, and reformat the drive.
    When I try to copy the files onto another drive using Finder, it copies part of the file and then gives me a "File in use" error and stops. I tried copying via Terminal and its the same - this time I get a "Resource busy" error.
    There are no other apps accessing the files. And this happens for every file on the drive.
    So how do I go about copying the files off the drive?
    I tried using DiskWarrior but it was stuck on Step 1 - Searching for Volume Information, after 3 hours.
    I really need to get the Aperture Library off the drive. Any ideas on how I can copy it across?
    Thanks

    This did not work. I still get an error trying to repair with Disk Utility.
    It gets to
    Starting repair tool:
    Checking file system
    Checking Journaled HFS Plus volume.
    Checking extents overflow file.
    Checking catalog file.
    Checking multi-linked files.
    Checking catalog hierarchy.
    Checking extended attributes file.
    The volume MEDIA could not be verified completely.
    Volume repair complete.
    Updating boot support partitions for the volume as required.
    Error: Disk Utility can’t repair this disk. Back up as many of your files as possible, reformat the disk, and restore your backed-up files.
    So DiskUtility tells me to backup as many files as possible. However, when I try copying these files, I get a "File in use" error.

  • Yosemite 10.10.1 will not allow me to copy multiple files to a NAS -error file in use, but other OS OK.

    I am running Mac OS 10.10.1 on a Mac Mini with 16G.
    I have a Buffalo NAS and wanted to copy files from one folder on the NAS  to another on the NAS.
    Under Yosemite I can only copy them one at a time. If I try to copy more than one I get an error message that the file is in use.
    Under SNS 10.6.3 (running under Parallels) I can easily copy a large number of files.
    Again under 10.10.1 I get the same problem when copying from my desktop to the NAS.
    The files are definitely not in use elsewhere and in any case if they were I wouldn't be able to copy one at a time.
    When I try to copy multiple files the OS creates greyed out icons of all the files to copy and then aborts when it actually tries to copy the first file.
    Any clues please, my current work around is to compress all the files to move, move the archive, expand the archive. This is not going to work for very large numbers of files - l'll be at it all day.
    Tony

    I have been unable to drag and drop large files, even onto the Desktop, let alone onto my NAS - I get the dragged files freezing in the middle of the screen or I get the 'unable to copy / file in use' error.
    Talking to Apple Support, they had me set up a new User, and then within that new account, the trouble went away. This pointed to the StartUp items being run in the original troublesome account,
    I have deleted all of my 3rd Party programs and then installed them one by one until the problem came back, and in my case (Macbook Air 5,2 running 10.10.3 Yosemite) I found it was DropBox causing the conflict. I have DropBox running in the Menu Bar (top of screen) and disabling sync (bottom left corner) stopped the file copy problem. Try disabling DropBox sync is file copying is failing?

  • How to read file WITHOUT full path using TEXT_IO?

    We have a scenario like this:
    -- We have a Telco application.
    -- That has 3 types of installations. English and Spanish
    -- We have 2 App Servers (Eng & Spa) for the 2 installation types.
    -- But there is only ONE DB. I.e. users logging into Eng or Spa AS versions login to the same DB.
    -- We have to maintain 2 login forms because of Eng and Spa, because the menu labels have to come in 2 langs.
    -- I am trying to have one tree menu for this.
    -- To do this I did this.
    -- Put a text file in the Forms directory of the AS.
    -- The file has just one line. ENGLISH or SPANISH.
    -- I read this file and find out the language and then show labels according the language.
    Problem is that when I used TEXT_IO and gave file name like this filename:=GET_FILE_NAME('Avabill_AS_Language.txt', File_Filter=>'Text Files (*.txt)|*.txt|');
    I get a error saying file not found.
    I found out that with TEXT_IO you need FULL PATH of the file. Thing is path of the installation depends of installation to installation. I cannot create a parameter in the DB since the DB is COMMON. I HAVE TO use a text file in the AS directory.
    Is there any other way like reading the Default.env file or FormsWeb.cfg? Is there a parameter in any of these files which specifies the forms directory absolute path. I studied both file but could not find an entry.
    Any workaround would be greatly appreciated.

    Thanks BaiG for the quick response.
    U r right about that GET_FILE_NAME.
    I removed that and put the file name only and tried. Still get the same error.
    FUNCTION Avabill_Deployment_Type RETURN VARCHAR2 IS
    v_language VARCHAR2(100);
    in_file Text_IO.File_Type;
    BEGIN
    in_file := Text_IO.Fopen( *'Avabill_AS_Language.txt'* , 'r');
    Text_IO.Get_Line(in_file, v_language );
    Text_IO.Fclose(in_file);
    RETURN v_language;
    EXCEPTION
    WHEN OTHERS THEN
    Text_IO.Fclose(in_file);
    ALERT_MESSAGE(1,'FILE NOT FOUND: ' || SQLERRM);
    RETURN 'Normal';
    END;
    I get this error:
    *302000: non-ORACLE exception*
    As for you query:
    -- We have 2 app servers. One English and One Spanish.
    -- So we have 2 sets of forms. One English with English labels in the forms and the other with Spanish Labels.
    -- So we HAVE to have 2 menu forms as well, don't we? When the menu form is run how does it know whether the app server is English or Spanish.
    -- There is no way to find out. We cannot use a DB variable since BOTH use the same DB (at the same time). Eng users will enter in English while Spanish users will enter in Spanish.
    I don't see how we can have one menu form for this purpose. Can u elaborate your method further please?

  • Reading data from flat file Using TEXT_IO

    Dear Gurus
    I already posted this question but this time i need some other changes .....Sorry for that ..
    I am using 10G forms and using TEXT_IO for reading data from flat file ..
    My data is like this :-
    0|BP-V1|20100928|01|1|2430962.89|27|2430962.89|MUR|20100928120106
    9|2430962.89|000111111111|
    1|61304.88|000014104113|
    1|41961.73|000022096086|
    1|38475.65|000023640081|
    1|49749.34|000032133154|
    1|35572.46|000033093377|
    1|246671.01|000042148111|
    Here each column is separated by | . I want to read all the columns and want to do some validation .
    How can i do ?
    Initially my requirement was to read only 2 or 3 columns so i did like this ...
    Procedure Pay_Simulator(lfile_type varchar2,lac_no varchar2,lcur varchar2,lno_item number,ltotal number,ldate date,lpay_purp varchar2,lfile_name varchar2)
    IS
    v_handle utl_file.file_type;
    v_filebuffer varchar2(500);
    line_0_date VARCHAR2 (10);
    line_0_Purp VARCHAR2 (10);
    line_0_count Number;
    line_0_sum number(12,2);
    line_0_ccy Varchar2(3);
    line_9_sum Number(12,2);
    line_9_Acc_no Varchar2(12);
    Line_1_Sum Number(12,2);
    Line_1_tot Number(15,2) := 0;
    Line_1_flag Number := 0;
    lval number;
    lacno varchar2(16);
    v_file varchar2(20);
    v_path varchar2(50);
    Begin
    v_file := mcb_simulator_pkg.GET_FILENAME(lfile_name); -- For the file name
    v_path :=rtrim(regexp_substr( lfile_name , '.*\\' ),'\'); For the Path
    v_path := SUBSTR (lfile_name,0, INSTR (lfile_name, '\', -1));
    v_handle := UTL_FILE.fopen (v_path, v_file, 'r');
    LOOP
    UTL_FILE.get_line (v_handle, v_filebuffer);
    IF SUBSTR (v_filebuffer, 0, 1) = '0' THEN
    SELECT line_0 INTO line_0_date
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_0, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 3;
    SELECT line_0 INTO line_0_Purp
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_0, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 4;
    SELECT line_0 INTO line_0_count
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_0, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 7;
    SELECT line_0 INTO line_0_sum
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_0, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 8;
    SELECT line_0 INTO line_0_ccy
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_0, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 9;
    ELSIF SUBSTR (v_filebuffer, 0, 1) = '9' THEN
    SELECT line_9 INTO line_9_Acc_no
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_9, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 3;
    SELECT line_9 INTO line_9_sum
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_9, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 2;
    ELSIF SUBSTR (v_filebuffer, 0, 1) = '1' THEN
    line_1_flag := line_1_flag+1;
    SELECT line_1 INTO line_1_sum
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_1, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 3;
    Line_1_tot := Line_1_tot + line_1_sum;
    END IF;
    END LOOP;
    DBMS_OUTPUT.put_line (Line_1_tot);
    DBMS_OUTPUT.PUT_LINE (Line_1_flag);
    UTL_FILE.fclose (v_handle);
    END;
    But now how can i do ? Shall i use like this select Statement for all the columns ?

    Sorry for that ..
    As per our requirement ...
    I need to read the flat file and it looks like like this .
    *0|BP-V1|20100928|01|1|2430962.89|9|2430962.89|MUR|20100928120106*
    *9|2430962.89|000111111111|*
    *1|61304.88|000014104113|*
    *1|41961.73|000022096086|*
    *1|38475.65|000023640081|*
    *1|49749.34|000032133154|*
    *1|35572.46|000033093377|*
    *1|246671.01|000042148111|*
    *1|120737.25|000053101979|*
    *1|151898.79|000082139768|*
    *1|84182.34|000082485593|*
    I have to check the file :-
    Validation are 1st line should start from 0 else it should raise an error and insert that error into one table .
    The for 2nd line also same thing ..it should start from 9 else it should raise an error and insert that error into one table .
    Then the 3rd line should start from 1 else it should raise an error and insert that error into one table .
    After that i have to do a validation like i will read the 1st line 2nd column .. It should be like this BP-V1 else raise an error and insert that error to a table . Then i will check the 3rd column which is 20100928 , it should be YYYYMMDD format else same thing ERROR.
    Then like this for all columns i have different validation .......
    Then it will check for the 2nd line 3rd column . this is an account no .1st i will check it should be 12 char else ERROR .Then I will check that what user has imputed in the form.Like for example User putted 111111111 then i will check with this 000111111111 which is there in the 2nd line . I have to add 000 before that Account no which user imputed .
    Then the lines which is starting from 1 , i have to take all the 2nd column for all the lines which is starting from 1 and i have to do a sum . After that i have to compare that sum with the value in the 1st lines ( Starting from 0) 6th column . It should be same else ERROR ...
    Then same way i have to count all the lines which is starting from 1 . Then i have to compare with the 7th column of 1st line . It should be same . Here in this file it should be 9.
    MY CODE IS :-
    Procedure Pay_Simulator(lfile_type varchar2,lac_no varchar2,lcur varchar2,lno_item number,ltotal number,ldate date,lpay_purp varchar2,lfile_name varchar2)
    IS
    v_handle TEXT_IO.file_type;
    v_filebuffer varchar2(500);
    line_0_date VARCHAR2 (10);
    line_0_Purp VARCHAR2 (10);
    line_0_count Number;
    line_0_sum number(12,2);
    line_0_ccy Varchar2(3);
    line_9_sum Number(12,2);
    line_9_Acc_no Varchar2(12);
    Line_1_Sum Number(12,2);
    Line_1_tot Number(15,2) := 0;
    Line_1_flag Number := 0;
    lval number;
    lacno varchar2(16);
    v_file varchar2(20);
    v_path varchar2(50);
    LC$String VARCHAR2(50) ;--:= 'one|two|three|four|five|six|seven' ;
    LC$Token VARCHAR2(100) ;
    i PLS_INTEGER := 2 ;
    lfirst_char number;
    lvalue Varchar2(100) ;
    Begin
    v_file := mcb_simulator_pkg.GET_FILENAME(lfile_name); For the file name
    v_path :=rtrim(regexp_substr( lfile_name , '.*\\' ),'\'); For the Path
    --v_path := SUBSTR (lfile_name,0, INSTR (lfile_name, '\', -1));
    Message(lfile_name);
    v_handle := TEXT_IO.fopen(lfile_name, 'r');
              BEGIN
                        LOOP
                        TEXT_IO.get_line (v_handle, v_filebuffer);
                        lfirst_char := Substr(v_filebuffer,0,1);
                        --Message('First Char '||lfirst_char); 
                                  IF lfirst_char = '0' Then
                                  Loop
                                  LC$Token := mcb_simulator_pkg.Split( v_filebuffer, i , '|') ;
                                  Message('VAL - '||LC$Token);
                                  lvalue := LC$Token;
                                  EXIT WHEN LC$Token IS NULL ;
    i := i + 1 ;
    End Loop;
                                  Else
                                       Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (9999,'0002','First line should always start with 0');
                                       Forms_DDL('Commit');
                                       raise form_Trigger_failure;
                                  End if ;
                        TEXT_IO.get_line (v_handle, v_filebuffer);
                        lfirst_char := Substr(v_filebuffer,0,1);
                        LC$Token := mcb_simulator_pkg.Split( v_filebuffer, i , '|') ;
                        --Message('Row '||LC$Token);
                             IF lfirst_char = '9' Then
                                  Null;
                             Else
                                  Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (8888,'0016','Second line should start with 9');
                                  Forms_DDL('Commit');
                                  raise form_Trigger_failure;
                             End IF;
                        LOOP
                        TEXT_IO.get_line (v_handle, v_filebuffer);
                        lfirst_char := Substr(v_filebuffer,0,1);
                        LC$Token := mcb_simulator_pkg.Split( v_filebuffer, i , '|') ;
                        --Message('Row '||LC$Token);
                                  IF lfirst_char = '1' Then
                                  Null;
                                  Else
                                       Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (7777,'0022','The third line onward should start with 1');
                                       Forms_DDL('Commit');
                                       raise form_Trigger_failure;
                                  End if;
                        END LOOP;
                        --END IF;
                        END LOOP;
              EXCEPTION
                   When No_Data_Found Then
              TEXT_IO.fclose (v_handle);
              END;
    Exception
         When Others Then
         Message('Other error');
    END;
    I am calling the FUNCTION which you gave SPLIT as mcb_simulator_pkg.Split.

Maybe you are looking for