Reading an entry form a txt file in unix from Forms50

Hello all,
In the windows version D2k there is a pll in the
demo.d2kwutil.pll, this pll can be used to read/writ from/to ini
files
and registry strings.
Can anybody tell me if there is a similar feature in the UNIX
version to read/write entries from/to a text file. Also Is there
a package for working with environment settings.
Thanks,
Sunder
null

It you want to read/write to the client side use text_io.
If you wnat to read/write to the server side use utl_file.
Petr Valouch (guest) wrote:
: Sunder (guest) wrote:
: : Hello all,
: : In the windows version D2k there is a pll in the
: : demo.d2kwutil.pll, this pll can be used to read/writ from/to
: ini
: : files
: : and registry strings.
: : Can anybody tell me if there is a similar feature in the UNIX
: : version to read/write entries from/to a text file. Also Is
: there
: : a package for working with environment settings.
: : Thanks,
: : Sunder
: Hi,
: In all system you can use TEXT_IO build-in package to
: read/write form/to text files.
: Petr Valouch
null

Similar Messages

  • Problem of reading the content of this .txt files

    currently i have a problem of reading the content of this file castle.txt
    #Server Ready.
    Lee Siaw Kang 50256808:08:382004/03/15Abdul Rahman 60296008:13:242004/03/15Kenneth Lee 60299308:13:532004/03/15Ho Kid Peng 31337508:17:442004/03/15Tonny Sherbern 50271108:19:132004/03/15Frederick Foh 50257908:20:212004/03/15Jason Kho 61702908:21:312004/03/15Lois Lee Liarn Huee 61897408:22:522004/03/15Victor Palau Udih 31337308:23:202004/03/15Michelle Sim 61899008:27:412004/03/15Alan Hong 50262708:30:312004/03/15Frederick Foh 50257908:33:412004/03/15Douglas Aseng 50255808:36:442004/03/15Atika Abang 31347508:36:592004/03/15David Dzrandinuraidi 61239608:38:012004/03/15Sentia Brangking 61896808:39:502004/03/15Dinah Samuel 61704608:40:582004/03/15Dr. Anderson Tiong 61702508:42:102004/03
    it is something like this ...i want to break it into readable format ...i have tried vector with is the following code.
    import java.util.*;
    import java.io.*;
    public class parseCastle {
    public static Vector parseInfo(String str) {
    int recordSize = 59;
    Vector v = new Vector();
    for (int i=0; i<str.length(); i+=recordSize) {
    String str1 = str.substring(i, i+recordSize);
    Vector vi = new Vector();
    vi.addElement(str1.substring(0, 35));
    vi.addElement(str1.substring(35, 41));
    vi.addElement(str1.substring(41, 49));
    vi.addElement(str1.substring(49, 59));
    v.addElement(vi);
    return v;
    //constructor
    parseCastle(){
    try
    FileInputStream fin = new FileInputStream("castle.txt");
    File fprop = new File("castle.txt");
    byte[] data = new byte[(int)fprop.length()];
    int total = fin.read(data);
    if (total != data.length) {
    System.err.println("Error loading file");
    return;
    //System.out.println(data.length);
    Vector v = parseInfo(new String(data));
    for (int i=0; i<v.size(); i++) {
    Vector vi = (Vector)v.elementAt(i);
    for (Enumeration e = vi.elements(); e.hasMoreElements();)
    System.out.println(e.nextElement());
    System.out.println();
    //*** Alternative ***
    //for (int k=0; k<vi.size(); k++)
    // System.out.println(vi.elementAt(k));
    catch (IOException e)
         System.out.println("Error: "+e);
         e.printStackTrace();
    But it gave me error. like it exceeds array boundary...can someone expert help me out

    You should be aware that these kind of effort always involves certain amount of risk because the proper record format is not hundred percent guaranteed. So, make sure to use properly formatted file, or genuine database instead.
    import java.io.*;
    import java.util.regex.*;
    public class ParseCastle2{
      public static void main(String[] args) throws Exception{
        String line, data;
        BufferedReader br = new BufferedReader(new FileReader("castle.txt"));
        br.readLine(); //discard #Server Ready line
        line = br.readLine();
        Pattern pat = Pattern.compile("([ .A-Za-z]+)([/0-9:]+)");
        Matcher mat = pat.matcher(line);
        Pattern subPat = Pattern.compile("(\\d+):(\\d\\d:\\d\\d)(.+)");
        while (mat.find()){
          System.out.println(mat.group()); // if name only, use group(1) ... beware trailing space
          data = mat.group(2);
          Matcher subMat = subPat.matcher(data);
          while (subMat.find()){
            System.out.println(" cdID = " + subMat.group(1));
            System.out.println(" Time = " + subMat.group(2));
            System.out.println(" Date = " + subMat.group(3));

  • Need to form a txt file

    Hi Guys
      i have a txt file ,the contect as below
    =====================
    APPData-CADD_RO_CNZJ
    APNET\USER1
    APNET\USER2
    APPData-CADD_RW_CNZJ
    APNET\USER3
    APNET\USER4
    =========================
    what i want was to conver it to a csv file like , can this possible ?
    APPData-CADD_RO_CNZJ   APNET\USER1
    APPData-CADD_RO_CNZJ   APENT\USER2
    APPdata-CADD_RW_CNZJ   APNET\USER3
    APPdata-CADD_RW_CNZJ   APNET\USER4

    Please don't cross post in the Flash forums.

  • How to read the data in a txt file on a web site?

    I want to extract the numbers located in txt files on a web site. It's a normal url. Not a ftp.
    Does anyone know how to do it?

    Hi Tom,
    What do you want to extract from the text file??
    I wanted to extract an IP address from a pearl script from my FTP server and this was the vi that I used .I dont know if you are trying to do the same?
    Here is the vi.It is in LV 7.1
    Hope its helps .
    Good luck.
    ohiofudu.
    Certified LabVIEW Architect
    Certified TestStand Developer
    Attachments:
    PublicIP-Adresse.vi ‏31 KB

  • Why does Adobe reader on iPad lock unlocked pdf files on move from computer

    I Have copied several pdf files, which I have made, from my laptop to my iPad. On my laptop they are unlocked and I can Add text etc. On the iPad they become locked and I cannot do this. Why? How do I stop this so that's can have u locked pdf files on my iPad.

    Rbradford,
    Did you add document restrictions or an "Open Password" protection to your PDF documents?  When you add any of document security features to a PDF document, it will be encrypted.
    Currently, Adobe Reader mobile products do not support adding annotations to encrypted PDF documents or filling out encrypted PDF forms, for example.
    To check whether your PDF document is encrypted
    Open your PDF document in the desktop version of Adobe Reader or Acrobat Pro.
    Select File > Properties... from the menu.  (Or press Command+D for Mac, Control+D for Windows.)
    Select the Security Tab.
    Click the Show Details... button (if enabled).
    Check the last entry in the Document Security dialog.
    If this is not the case, please send one of your PDF documents to [email protected] and include the link to this forum post (https://forums.adobe.com/thread/1593031) in your email message for reference.
    We will inspect the PDF document and diagnose the cause of the problem.  Thank you.

  • Address Book NOT accepting csv.txt file as import from EARTHLINK web mail

    Greetings. Unsuccessful thus far in importing e-addresses from Earthlink Web Mail to MAC Address Book. Found preferences and saved Earthlink addresses as csv.txt file but AB rejected as not true csv. Apple suggested conversion to V cards but could not find that option in Earthlink-ville. Perused Allan's post on synching with Total Access but fear accidentally installing stuff on my MACbook Pro from that application that is unneccessary or will screw up my new MAC world. Although in the long run, having Web mail back up my MAC makes sense. (Work and husband remain PC/ XP.)
    Any solutions you can offer will be much appreciated.
    Macbook Pro   Mac OS X (10.4.9)  

    Thanks again. Okay, I pasted a portion of the csv file . I might be mistaken here, but I don't think these are V card format and perhaps converting them to V cards is what I'd have to do. But I would need pretty explicit directions.
    Regards,
    Andrea
    "First Name","Last Name","Middle Name","Name","Nickname","E-mail Address","E-mail 2 Address","E-mail 3 Address","Home Street","Home City","Home Postal Code","Home State","Home Country/Region","Home Phone","Home Fax","Mobile Phone","Personal Web Page","Business Street","Business City","Business Postal Code","Business State","Business Country/Region","Business Web Page","Business Phone","Business Fax","Pager","Company","Job Title","Department","Office Location","Notes"
    "[email protected]","","","[email protected]","","[email protected]","","","","" ,"","","","","","","","","","","","","","","","","","","","",""
    "Thomas","Brown","","Thomas Brown","","[email protected]","","","","","","","","","","","","","","",""," ","","","","","","","","",""
    "Bob","Nash","","Bob Nash","","[email protected]","","","","","","","","","","","","","","","", "","","","","","","","","",""

  • Invalid charater in Excel when input .txt file that run from Oracle discove

    Hi All,
    I ran a report from oracle discover and saved as txt file, then open it with excel, the chinese will be shown as invalid character.
    The problem is that Chinese characters can't be displayed well if I download the report (in csv ) from discover desktop version on my computer and open it with excel.
    Pls. help to resolve the problem.
    Thanks.

    Hello
    I'm afraid that I don't have much experience of working with Chinese characters and can see nothing in my notes that might help. Give it a couple of days for others to reply and if you don't get anywhere I recommend raising this as a service request with Oracle Support.
    Best wishes
    Michael

  • How to Read the Timestamp of a File on Unix from Form?

    If you have a file located on UNIX operating, what is the best way to read the time stamp (the date that file has been created) of that file from Oracle SQL, SQL*plus, or Developer Forms 6i/9i/10g?

    Thanks Robin for the reply! Your suggestion seems to be good!
    However, We found a solution now! I would like to share with you the way we did, in case anyone out there need the solution:
    In SQL*Plus, we created a Java Source below:
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "FileDate"
    AS
    import java.io.File;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    public class FileDate {
    public static String GetDate(String strFilePath) {
    String ReturnValue = null;
    if (strFilePath == null || strFilePath.length()==0)
    // do nothing
    else
    File aFile = new File(strFilePath);
    if (aFile.exists())
    long lngTime = aFile.lastModified();
    Date aDate = new Date(lngTime);
    SimpleDateFormat fmtDate =
    new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
    ReturnValue = fmtDate.format(aDate);
    fmtDate = null;
    aDate = null;
    aFile = null;
    return ReturnValue;
    -- Then we created a wrapper to call the Compiled Java above:
    CREATE or REPLACE FUNCTION FileDate_GetDate(FilePath IN STRING)
    RETURN VARCHAR2 IS
    LANGUAGE JAVA
    NAME 'FileDate.GetDate(java.lang.String) return int';
    -- Then we created a database package:
    -- Package Spec:
    PACKAGE sap_dnld AS
    FUNCTION get_file_date2 (s1 varchar2) RETURN VARCHAR2;
    END sap_dnld;
    -- Package Body:
    PACKAGE BODY sap_dnld AS
    FUNCTION get_file_date2( s1 VARCHAR2 )
    RETURN VARCHAR2 AS LANGUAGE JAVA
    NAME 'FileDate.GetDate(java.lang.String) return int';
    END sap_dnld;
    -- Then we tested the whole thing in SQL*Plus:
    set serveroutput on;
    declare
    x varchar2(2000);
    begin
    x := sap_dnld.get_file_date2;
    dbms_output.put_line(x);
    end;
    -- Then we called the function from the package using a procedure from the form:
    PROCEDURE Find_date IS
    BEGIN
    :control.file_date := sap_dnld.get_file_date2('directory1/subdirectory/filename.txt');
    END;

  • Remove "zeros" form a txt file created by Labview

    Hi everyone,
    I got a problem with my txt data and I hope somebody will help here.
    I'm doing measuremnts and I'm saving the data in a txt. 
    The saved data look like that:  0.000000
                                                     1.743435
                                                     2.899894
    My question

    duplicate post
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Read XML File on Unix from PL SQL

    Hi,
    How to read XML file placed on Unix Dir .
    If file name is yx.xml and file contain below data. Please let me know how to read
    column values such as AutomatedTransferOrders uniqueId="11761:234570"
    2)Cto Type = CTO
    3)Description = Test PIP
    <AgileData xsi:schemaLocation="http://www.oracle.com/ http://www.oracle.com/technology/products/applications/xml/aXML.xsd">
    <AutomatedTransferOrders uniqueId="11761:234570">
    <CoverPage>
    <CtoType>CTO</CtoType>
    <CtoNumber>CTO00069</CtoNumber>
    <Description>Created by subscriber DBA Program Prototype Change Subscriber.</Description>
    <Status>Released</Status>
    <Workflow>Default CTOs</Workflow>
    <Subscriber>DBA Program Prototype Change Subscriber</Subscriber>
    <DateOriginated>2012-03-15T00:29:10Z</DateOriginated>
    <DateReleased>2012-03-15T00:29:11Z</DateReleased>
    </CoverPage>
    <SelectedObjects referentId="6000:6243458">
    <Type>Program Change Order</Type>
    <NameNumber>PG0000038</NameNumber>
    <Description>Test PIP</Description>
    <LifecycleStatus>Released</LifecycleStatus>
    </SelectedObjects>
    </AutomatedTransferOrders>
    </AgileData>
    Appreciate your help.
    Thanks and Regards,
    Abhi

    sample
    Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.3.0
    Connected as apps
    SQL>
    SQL> with t as
      2   (select xmltype('<AgileData>
      3    <AutomatedTransferOrders uniqueId="11761:6243470">
      4      <CoverPage>
      5        <AtoType>ATO</AtoType>
      6        <AtoNumber>ATO00069</AtoNumber>
      7        <Description>Created by subscriber BDA Program Prototype Change Subscriber.</Description>
      8        <Status>Released</Status>
      9        <Workflow>Default ATOs</Workflow>
    10        <Subscriber>BDA Program Prototype Change Subscriber</Subscriber>
    11        <DateOriginated>2012-03-15T00:29:10Z</DateOriginated>
    12        <DateReleased>2012-03-15T00:29:11Z</DateReleased>
    13      </CoverPage>
    14      <SelectedObjects referentId="6000:6243458">
    15        <Type>Program Change Order</Type>
    16        <NameNumber>PG0000038</NameNumber>
    17        <Description>Test PIP</Description>
    18        <LifecycleStatus>Released</LifecycleStatus>
    19      </SelectedObjects>
    20    </AutomatedTransferOrders>
    21    <ChangeOrders uniqueId="6000:6243458">
    22      <Workflow>
    23        <StatusCode>Process is moved forward</StatusCode>
    24        <WorkflowStatus>Pending</WorkflowStatus>
    25        <Workflow>BDA Program Prototype Workflow</Workflow>
    26        <StatusChangedBy>Gay Groce (ggroce)</StatusChangedBy>
    27        <LocalClientTime>2012-03-15T00:29:11Z</LocalClientTime>
    28      </Workflow>
    29      <Workflow>
    30        <StatusCode>Process is skipped</StatusCode>
    31        <WorkflowStatus>PD Approval</WorkflowStatus>
    32        <Workflow>BDA Program Prototype Workflow</Workflow>
    33        <StatusChangedBy>Gay Groce (ggroce)</StatusChangedBy>
    34        <LocalClientTime>2012-03-15T00:29:11Z</LocalClientTime>
    35      </Workflow>
    36      <Workflow>
    37        <StatusCode>Current Process</StatusCode>
    38        <WorkflowStatus>Released</WorkflowStatus>
    39        <Workflow>BDA Program Prototype Workflow</Workflow>
    40      </Workflow>
    41      <Workflow>
    42      <StatusCode>Future Process</StatusCode>
    43        <WorkflowStatus>Implemented</WorkflowStatus>
    44        <Workflow>BDA Program Prototype Workflow</Workflow>
    45      </Workflow>
    46    </ChangeOrders>
    47  </AgileData>') col
    48      from dual)
    49  --
    50  select x.*
    51    from t,
    52         xmltable('AgileData/ChangeOrders/Workflow'
    53                  passing t.col
    54                  columns StatusCode varchar2(100) path 'StatusCode',
    55                          WorkflowStatus varchar2(100) path 'WorkflowStatus',
    56                          Workflow varchar2(100) path 'Workflow',
    57                          StatusChangedBy varchar2(100) path 'StatusChangedBy',
    58                          LocalClientTime varchar2(100) path 'LocalClientTime') x
    59  /
    STATUSCODE                                                                       WORKFLOWSTATUS                                                                   WORKFLOW                                                                         STATUSCHANGEDBY                                                                  LOCALCLIENTTIME
    Process is moved forward                                                         Pending                                                                          BDA Program Prototype Workflow                                                   Gay Groce (ggroce)                                                               2012-03-15T00:29:11Z
    Process is skipped                                                               PD Approval                                                                      BDA Program Prototype Workflow                                                   Gay Groce (ggroce)                                                               2012-03-15T00:29:11Z
    Current Process                                                                  Released                                                                         BDA Program Prototype Workflow                                                                                                                                   
    Future Process                                                                   Implemented                                                                      BDA Program Prototype Workflow                                                                                                                                   
    SQL>

  • How to run .ksh file in unix from .jsp files

    Hi frnd,
    How to connect unix servers from .jsp file & I want to run unix scripts .ksh files from .jsp files
    Thanku
    bhupathipawan

    It is usually a bad idea to do any major processing directly within a JSP. It is better to create a helper class and invoke methods on that. This helper class can then be tested outside of the inhospitable JSP environment.
    To run the '.ksh' file you will need to use either Runtime.exec() or the more modern ProcessBuilder. You will save yourself a lot of grief if you read thoroughly the 4 sections of http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html and then implement the recommendations.
    Note - although the 'traps' article is written around the use of Runtime.exec(), it's content is equally applicable to ProcessBuilder.

  • Printing a URL pdf file on Unix from a URL

    Has anyone, managed to print a pdf file from a URL to UNIX via "lp" without first saving the file and then printing from the saved file via Runtime.getRuntime().exec().
    Welcome suggestions on alternatives if not possible ?

    One simple option which doesn't explicitly require a '.exec' would be to write a Java program which writes the PDF data from the URL to the console, and pipe the output to lp from the shell.
    % java PDFURLWriter | lp
    Good luck,
    -Derek

  • How to use certain entries from a txt file as metadata?

    So during my plugin development I stumbled on a problem.
    I have created a txt file for each picture telling me who's in the photos. So the first column in the file shows all the names that appear in the photo.
    I want to add those names into LR for each photo. I thought using them as metadata would be a good idea. Then I could let the user enter a name of some person and create a smart collection having all photos with that person in them.
    But putting it into practice isn't that easy.
    So I started with the classic metadata definition:
    metadataFieldsForPhotos = {
      id = 'Person',
      title = 'Person'
      dataType = 'string',
      searchable = true,
      browsable = true,
    Now I don't know how to actually read only the column entries of the txt file and displaying all the names appearing in it. Another problem is that each photo has its own txt file in "nameofphoto.jpg.txt" So LR must know which txt file belongs to a photo.
    I know my question isn't very specific but it would be great if someone could help...

    Thank you for the reply. Reading the file how I wanted worked fine and I chose to use keywords, as you suggested.
    So now I tried to add the keywords to the pictures and I get:
    "LrCatalog:withWriteAccessDo: could not execute action 'keywordProvider'. It was blocked by another write access call, and no timeout parameters were provided."
    There's my function so far:
    function Finder.findPerson(smartCollectionName)
         local catalog = LrApplication.activeCatalog()
         local photos = catalog:getMultipleSelectedOrAllPhotos()
           LrTasks.startAsyncTask( function()
                for i=1,#photos do
                     local photo = photos[i]
                     local photopath = photo:getRawMetadata("path")
                     local photoname = photo:getFormattedMetadata("fileName")
                     local folderpath = string.sub(photopath, 1, string.len(photopath) - string.len(photoname))
                     local metadataPath = folderpath .. "\.metaface\\" .. photoname .. ".txt"
                     local text = LrFileUtils.readFile(metadataPath)
                     local metadataValues = stringSplit(text)
                     for i = 0, #metadataValues do
                          catalog:withWriteAccessDo( "keywordProvider", function()
                               local keywords = catalog:createKeyword(metadataValues[i])
                               photos:addKeyword(keywords)
                          end)
                     end
               end
          end)
    end
    So what am I doing wrong?

  • Read a txt file & pass it to AppleScript

    I was originally going to try to do this purely with AppleScript, but someone (who knows a lot more than me) told me it would be better to do it with a shell script.
    What I want to do is read the contents of a txt file, which would contain a single URL. It would then pass the contents of that text file (the URL) on to be run by AppleScript, via osascript. Here's the AppleScript that should be run via osascript:
    tell application "Safari"
      add reading list item fileContents
    end tell
    So basically it would grab the URL from the text file and add it to Safari's Reading List. Any help would be greatly apreciated.

    Here's the thing...
    It's almost impossible to get a shell script to interact with Safari - not quite, but bizarrely difficult.
    AppleScript, on the other hand, is designed with the explicit goal of facilitating inter-process communication - one process telling another process to do something.
    To do it all via the shell would likely either mean directly manipulating Safari's preference files to include the data you want, or invoking AppleScript (via osascript) to tell Safari what you want it to do.
    The former is a nightmare proposition, which leaves the latter, and if you're going to resort to using AppleScript (even via osascript) then why not do the whole thing in AppleScript and be happy.
    At the end of the day it's about using the right tool for the job. AppleScript was designed for this kind of thing. It's hard to see a better way of doing it.
    I suspect your 'someone' doesn't really know as much as you think (or they think )

  • How to open and edit "*.txt" file with "Notepad"

    Hello guys!
    I'm facing problem with SharePoint 2010 Enterprise and got no clue how to solve it.
    What I want to do is to open "*.txt" (which is placed to "Documents Library") in "Notepad", so I could edit it and save (publish) directly to SharePoint from "Notepad".
    If I upload any Microsoft office File, such as "*.docx", "*.xls", etc - it works as it should - document opens in appropriate application and everybody is happy.
    But, when I create documents library, put some "*.txt" file there and click on it - it opens in new browser's tab as text, so I cannot edit the file.
    What I tried to do is to activate feature "Open Documents in Client Applications by Default" - not happy.
    Edit "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML\DOCICON.XML" - I've modified "txt" entry as follows:
    <?xml version="1.0" encoding="utf-8"?>
    <DocIcons>
        <ByProgID>
        </ByProgID>
        <ByExtension>
    <Mapping Key="txt" Value="ictxt.gif" EditText="Notepad" OpenControl="SharePoint.OpenDocuments"/>
        </ByExtension>
        <Default>
            <Mapping Value="icgen.gif"/>
        </Default>
    </DocIcons>
    Still not happy.
    So, how do I make this stuff work?

    Found this link which has more information on this scenario:
    http://sharepoint.stackexchange.com/questions/1427/open-txt-file-in-notepad-from-sharepoint
    A programmatic workaround:
    http://weblogs.asp.net/bsimser/archive/2005/01/24/359911.aspx
    Andrew Milsark, MCITP,MCTS
    Fpweb.net - The SharePoint Hosting Pioneer
    Blog : http://blog.fpweb.net
    Twitter : http://www.twitter.com/amilsark

Maybe you are looking for

  • Boot windows 7 from an external ssd/thunderbolt drive

    I have an iMac 27", Mid 2011, 3.4 Ghz i7 Quad core with a 2TB internal HDD OSX 10.7.5 and a MacBook Air 2014 - Mavericks. I want to create either a 64Gb USB 3 Flash stick or, if necessary (as I would have to buy it) an external thunderbolt drive to r

  • RERAPP: Posting Procedure RETP

    Dear all, Does anyone know how to solve this error? -> Open item account line with flow type 9000 has to contain a partner (posting procedure RETP) This message appear when I choose option u201CTransferu201D in field Type of posting run in transactio

  • Pixelated images when connected 3G

    I've searched all over and seem to not be able to find a resolution for the issue I am having. It also seems I am the only person, I know with an iPhone, with this issue. Hopefully my issue can be resolved through the community. When I am connected 3

  • Can I use remote control with Winamp on my P100?

    Hello! I would like to know if it is possible to use the rc with other programs like winamp. Till now I am only able to use it with the media player. Greets Lukas

  • Do anyone have windows 8 key

    do anyone have windows 8 key