Urgent!!!  checking a text file!

Hello,
I have a text file with some info in it.
How do you cross-reference some text inside the text file with out importing the text file into a String???
example:
File myFile = new File(/file.txt);
// inside myFile contains the text: "the sun is great"how do you check if myFile contains the String "sun" ???
with out importing all the text in the file?
-RonX

DrClap wrote:
How do you cross-reference some text inside the text file with out importing the text file into a String???That's a pretty weird requirement. So can you tell us why it exists at all?you could use another memory structure :)
It probably exists because some teacher wants his kiddos to learn to think outside the box, and this kiddo is too incompetent to even notice the box it's in.

Similar Messages

  • How to check a text file is already opened by another process

    Hi All,
      We are facing a requirement to check a simple text file that has been already opened by some other process using java programming.We are using simple file reading concepts to read the content of those text file
      For eg: Let us take sample.txt in any of the system location which is manually opened and we need to check that sample.txt is opened or not using java programming.
                  If it is not opened by any process then only we should  read that file otherwise we shouldn't.
    ANY GUIDANCE WILL BE HELPFUL...
    Thanks & Regards,
    Rumeshbabu

    Hi Christian,
    Thanks. Our scenario is...
    1. We have log files(in.txt) which is scheduled everyday for tracking and the scheduler will be writing the file ,it will be closed by night 11.
    2.So in case if we write any java code to access that log file(using  io file concept in java) we need access to that log file from our standalone java program only after night 11 0 clock.
    3.So we should check a condition whether that log file has been already used by some other process.
    Thanks & Regards.
    Rumeshbabu

  • Read from text file, display in textarea

    java newbie here - I'm trying to write a chat program that checks a text file every 1 second for new text, and then writes that text to a textArea. I've got the thread setup and running, and it checks and text file for new text - all that works and prints to system console - but I have no idea how to print that text to a textArea.
    I've tried textArea.append, but it seems this only works on the initial run - if I put it in the thread, it won't work. I can make textArea.append work if its in an ActionEvent - but how would I make an ActionEvent run only when my script detects new text from my text file?
    Any ideas on how to do this are appreciated.
    --Mike                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I've tried textArea.append, but it seems this only works on the initial
    run - if I put it in the thread, it won't work. I can make textArea.append
    work if its in an ActionEvent - but how would I make an ActionEvent
    run only when my script detects new text from my text file? ?
    It doesn't matter if you call the textArea.append() when the ActionEvent is triggered or if you call textArea.append() directly from a thread or any other object, the text will be append to te text area. What could have happen is you somehow lost the reference pointing to the textArea that you add to your user interface.
    example:
    JTextArea txtArea = blah..blah..blah
    MyThread t = new myThread(txtArea);
    class MyThread extends Thread{
        private JTextArea txtArea;
        public MyThread(Thread textArea){
            this.textArea = textArea;
        public void run(){
            textArea = new JTextArea(); // opps..you lost the reference to the textArea in the main gui...what you have done is created a new JTextArea object and point to tat..and this textarea object is not visible.
    }

  • Create a Blank Text file if it does not exist in a Given Directory

    Hi,
    I would like to check if text file in a given folder exists or not if not then create a blank text file in a given directory. I was checking File system task, it has options to create directory and move files, copy files but not creating files.
    How can I create a blank text file in a given directory in SSIS using script task or any other way.
    Many thanks.
    Mustafa
    MH

    Thanks Saravana for your help. I am using the following code in the script Task two
    Imports System
    Imports System.Data
    Imports System.Math
    Imports Microsoft.SqlServer.Dts.Runtime
    Imports System.IO
    Imports System.Object
    Imports System.Security.Cryptography
    Imports System.IO.Compression
    <System.AddIn.AddIn("ScriptMain", Version:="1.0", Publisher:="", Description:="")> _
    <System.CLSCompliantAttribute(False)> _
    Partial Public Class ScriptMain
    Inherits Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
    Enum ScriptResults
    Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success
    Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
    End Enum
    ' The execution engine calls this method when the task executes.
    ' To access the object model, use the Dts property. Connections, variables, events,
    ' and logging features are available as members of the Dts property as shown in the following examples.
    ' To reference a variable, call Dts.Variables("MyCaseSensitiveVariableName").Value
    ' To post a log entry, call Dts.Log("This is my log text", 999, Nothing)
    ' To fire an event, call Dts.Events.FireInformation(99, "test", "hit the help message", "", 0, True)
    ' To use the connections collection use something like the following:
    ' ConnectionManager cm = Dts.Connections.Add("OLEDB")
    ' cm.ConnectionString = "Data Source=localhost;Initial Catalog=AdventureWorks;Provider=SQLNCLI10;Integrated Security=SSPI;Auto Translate=False;"
    ' Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.
    ' To open Help, press F1.
    Public Sub Main()
    ' Add your code here
    Dim inputFile As String
    Dim outputFile As String
    Dim encoding As String
    Dim PrivateKeyInXML As String
    inputFile = Dts.Variables("Item1Path").Value.ToString()
    outputFile = Dts.Variables("OutputFile1").Value.ToString()
    encoding = Dts.Variables("Encoding").Value.ToString()
    PrivateKeyInXML = Dts.Variables("PrivateKey").Value.ToString()
    Dim CallCryptoReader As CryptoReader = New CryptoReader(inputFile, outputFile, encoding, PrivateKeyInXML)
    Dts.TaskResult = ScriptResults.Success
    End Sub
    Public Class CryptoReader
    Private _FileStream As FileStream
    Private _CryptoStream As CryptoStream
    Private _ZipStream As GZipStream
    Private _RSAPrivateKeyinXML As String
    Dim _CryptoAgent As New System.Security.Cryptography.AesCryptoServiceProvider
    'System.Text.Encoding
    Sub New(ByVal inputFile As String, ByVal outputFile As String, ByVal encoding As String, ByVal PrivateKeyInXML As String)
    _RSAPrivateKeyinXML = PrivateKeyInXML
    'Create the crypto agent
    _CryptoAgent = AesCryptoServiceProvider.Create
    '''''''_CryptoAgent.GenerateIV()
    '''''''_CryptoAgent.GenerateKey()
    'Open cypher text for reading in
    _FileStream = New FileStream(inputFile, FileMode.Open)
    ReadHeaderFromFile() 'write out aes key to header
    'Create the stream to decrypt the AES part of the file
    _CryptoStream = New CryptoStream(_FileStream, _CryptoAgent.CreateDecryptor, CryptoStreamMode.Read)
    _ZipStream = New GZipStream(_CryptoStream, CompressionMode.Decompress)
    'setup complete - run decrypt to unprotect the rest of the file
    DecryptFile(outputFile)
    Flush()
    Close()
    Dispose()
    End Sub
    Public Sub Close()
    _CryptoStream.Close()
    _ZipStream.Close()
    _FileStream.Close()
    End Sub
    Public Sub Dispose()
    _CryptoStream.Dispose()
    _ZipStream.Dispose()
    _FileStream.Dispose()
    End Sub
    Public Sub Flush()
    _CryptoStream.Flush()
    _ZipStream.Flush()
    _FileStream.Flush()
    End Sub
    Private Sub ReadHeaderFromFile()
    'Read the AES Key (Protected by RSA Key) and then the IV
    Dim UnProtectedAESKey() As Byte
    Dim buffer(_CryptoAgent.BlockSize - 1) As Byte
    'Read in protected AES Key
    _FileStream.Read(buffer, 0, _CryptoAgent.BlockSize)
    'Decrypt AES Key
    UnProtectedAESKey = releaseKeyFromRSA(buffer)
    _CryptoAgent.Key = UnProtectedAESKey
    ReDim buffer(_CryptoAgent.IV.Length - 1)
    'get IV
    _FileStream.Read(buffer, 0, _CryptoAgent.IV.Length)
    _CryptoAgent.IV = buffer
    End Sub
    Public Sub DecryptFile(ByVal outFilePath As String)
    Dim outFile As New FileStream(outFilePath, FileMode.Create)
    Dim count As Integer = 1024
    Dim buffer(count - 1) As Byte
    Do Until count = 0
    count = _ZipStream.Read(buffer, 0, count)
    outFile.Write(buffer, 0, count)
    Loop
    outFile.Flush()
    outFile.Close()
    outFile.Dispose()
    End Sub
    Private Function releaseKeyFromRSA(ByVal key() As Byte) As Byte()
    Debug.Print("Protected AES Key - " & key.ToString)
    Dim cspParam As New CspParameters()
    Dim RSA As New RSACryptoServiceProvider(1024, cspParam)
    'private
    RSA.FromXmlString(_RSAPrivateKeyinXML)
    Dim decryptedAsByte() As Byte = RSA.Decrypt(key, True)
    Debug.Print("Release RSA - " & System.Text.Encoding.ASCII.GetString(decryptedAsByte))
    Return decryptedAsByte
    End Function
    End Class
    End Class
    I am using the Outputfile1 variable. this is the variable where the path of the file will come which was created in the previous script task. In this task i got the exception that it is alread in use.
    MH

  • Want to know how to check for new line character in text file

    Hi All,
    I`m trying to read data from text file. However I`m not sure whether the data is in 1st line or nth line. Now I`m trying to read the text from the readline. But if text is "" and not NULL then my code fails. So I want to know how to check for new line character and go to next line to find the data. Please help.
    Thanks
    static int readandwriteFile(Logger logger,String filepath){
              BufferedWriter out = null;
              BufferedReader in = null;
              File fr = null;
              int get_count = 0;
              try     {
              if(new File(filepath).exists())
              fr= new File(filepath);
                        System.out.println("FileName: "+fr);
                   if(fr != null){
    in = new BufferedReader(new FileReader(fr));
                             String text = in.readLine();
                             if(text != null){
                             get_count = Integer.parseInt(text);
                             in.close();
                             else{
                                  get_count = 0;
         else{                    
    out = new BufferedWriter(new FileWriter(filepath));
         out.write("0");
                out.close();
                   }          //Reading of the row count file ended.
              catch(Exception e) {
                   e.printStackTrace();
              finally {
                   try{               if (in != null) {
                             in.close();
              if (out != null) {
                             out.close();
              catch(Exception e) {
                        e.printStackTrace();
              return get_count;
         }

    You are calling the readline() only once which means you are reading only the first line from the file...
    Use a loop (Do-While preferably)
    do{
    //your code
    }while(text == "")

  • Upload text file to oracle table with checking and aggregation

    Hi Friends,
    I am new to ODI.  I have encountered a problem which is specific to ODI 11G (11.1.1.6.3) to upload text file to oracle table with checking and aggregation.  Would you please teach me how to implement the following requirement in ODI 11G?
    Input text file a:
    staffCode, staffCat, status, data
    input text file b:
    staffCodeStart, staffCodeEnd, staffCat
    temp output oracle table c:
    staffCat, data
    output oracle table d:
    staffCat, data
    order:
    a.staffCode, a.staffCat, a.status
    filter:
    a.status = ‘active’
    join:
    a left outerjoin b on a.staffCode between b.staffCodeStart and b.staffCodeEnd
    insert temp table c:
    c.staffCat = if b.staffCat is not null then b.staffCat else a.staffCat
    c.data = a.data
    insert table d:
    if c.staffCat between 99 and 1000 then d.staffCat = c.staffCat, d.data = sum(c.data)
    else d.staffCat = c.staffCat, d.data = LAST(c.data)
    Any help on fixing this is highly appreciated. Thanks!!
    Thanks,
    Chris

    Dear Santy,
    Many thanks for your prompt reply.  May I have more information about the LAST or SUM step?
    I was successful to create and run the following interfaces p and q
    1. Drag text file a to a newly created interface panel p
    2. Filter text file a : a.status = ‘active’
    3. Lookup text file a to text file b : a.staffCode between b.staffCodeStart and b.staffCodeEnd
    4. Drag oracle temp table c to interface panel p
    5. Set c.staffCat : CASE WHEN b.staffCat IS NULL THEN a.staffCat ELSE b.staffCat END
    6. Set c.data : a.data
    7. Drag oracle temp table c to a newly created interface panel q
    8. Drag oracle table d to interface panel q
    9. Set UK to d.staffCat
    10. Set Distinct Rows to table d
    11. Set d.staffCat = c.staffCat
    12. Set d.data = SUM(c.data)
    However, the interface q should be more than that:
    If c.staffCat is between 99 and 1000, then d.data = the last record c.data; else d.data = sum(c.data)
    Would you please teach me how to do the LAST or SUM steps?  Moreover, can interface p and interface q be combined to one interface and do not use the temp table c?  Millions thanks!
    Regards,
    Chris

  • How do I compare these text files (aka spell check)

    I'm having the hardest time figuring out how to get this spell check to work. Basically, I need to open the dictionary.txt file and then another file which will be spell checked. Ignoring case sensitivity, punctuation, and word endings (such as ly, ing, s). And then output to the user the words that were not found in the dictionary. Here is what I have so far (and it is very basic.... there is no attempt to compare yet since I don't know how to approach this). I only have it outputting to a JTextArea what is opened minus punctuation and upper case....
    import java.util.Scanner;
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    //  Created Sept 4, 2004
    *   @version 1.0
    *   This program will store dictionary.txt to a String array and
    *   open another text file to be specified by the user of the program.
    *   As the scanner proceeds through the document, it will spell check
    *   and output any (case insensitive) words not found in the
    *   dictionary.txt file.
    public class Spell extends JFrame {
        /** Area to place the individual words in the file */
        JTextArea outputDictionary, outputWord;
    *  Constructor for the class.  Sets up the swing components.
    *  Prompts the user for the files to be processed.  Then invokes
    *  the process method to actually do the work.
    public Spell() {
         // A JTextArea is used to display each word found in the file.
         outputDictionary=new JTextArea("Dictionary List\n\n");
         add (new JScrollPane(outputDictionary));
         //Set the size to 300 wide by 600 pixels high
         setSize(300,600);
         setVisible(true);
            outputWord=new JTextArea("Opened Document\n\n");
            add (new JScrollPane(outputWord));
            setSize(300,600);
            setVisible(true);
        //Prompts user for the dictionary.txt file
        JFileChooser dictionary = new JFileChooser();
        int returnVal = dictionary.showOpenDialog(this);
         if  (returnVal == JFileChooser.APPROVE_OPTION) {
              storeDictionary(dictionary.getSelectedFile());
        //Prompt user to open file to be checked          
        JFileChooser word = new JFileChooser();
        int returnVal2 = word.showOpenDialog(this);
            if (returnVal2 == JFileChooser.APPROVE_OPTION){
                storeOpenFile(word.getSelectedFile());
    public void storeDictionary(File dictionaryFile) {
         String dictionary="";
         Scanner scanner=null;
        try {
            // Delimiters specifiy where to parse tokens in a scanner
           scanner = new Scanner(dictionaryFile).useDelimiter("\\s*[\\p{Punct}*\\s+]\\s*");
        catch (FileNotFoundException fnfe) {
            JOptionPane.showMessageDialog(this,"Could not open the file");
           System.exit(-1);
         while (scanner.hasNext()) {         
              dictionary=scanner.next();
              if (!dictionary.equals(""))
                 outputDictionary.append(dictionary.toLowerCase()+"\n");
            System.out.println("Thank you, your dictionary is stored.");
    public void storeOpenFile(File openFile){
        String word="";
        Scanner scanner2 = null;
        try {
            // Delimiters specifiy where to parse tokens in a scanner
           scanner2 = new Scanner(openFile).useDelimiter("\\s*[\\p{Punct}*\\s+]\\s*");
        catch (FileNotFoundException fnfe) {
            JOptionPane.showMessageDialog(this,"Could not open the file");
           System.exit(-1);
        //stores the words in the opened text file in a String array
         while (scanner2.hasNext()) {         
              word=scanner2.next();
                 if(!word.equals(""))
                        outputWord.append(word.toLowerCase()+"\n");
        System.out.println("Thanks, your file has successfully been opened.");
    public static void main(String args[]) {
       Spell spellck = new Spell();
       spellck.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

    Yes, he actually recommends us to use java 1.5. I have revised my code to read into a TreeSet from the dictionary.txt, but I keep getting the following error when I compile:
    Note: C:\Jwork\spell1.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    Finished spell1.
    Also, when I execute, nothing happens. It looks like it is going to try to do something, but the "open" dialog box never opens and no errors pop up. It just sits there executing. Any suggestions??
    here is the code:
    import java.util.*;
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    //  Created Sept 4, 2004
    *   @version 1.0
    *   This program will store dictionary.txt to a String array and
    *   open another text file to be specified by the user of the program.
    *   As the scanner proceeds through the document, it will spell check
    *   and output any (case insensitive) words not found in the
    *   dictionary.txt file.
    public class spell1 extends JFrame{
        JTextArea output = new JTextArea(500,500);
        Set dict = new TreeSet();
        Set file = new HashSet();
        public spell1(){
        Set dict = new TreeSet();
        Set file = new HashSet();
        //Prompts user for the dictionary.txt file
        JFileChooser dictionary = new JFileChooser();
        JFileChooser wordFiles = new JFileChooser();
        int returnVal = dictionary.showOpenDialog(this);
         if (returnVal == JFileChooser.APPROVE_OPTION) {
         storeDictionary(dictionary.getSelectedFile());
        int returnVal2 = wordFiles.showOpenDialog(this);
            if (returnVal2 == JFileChooser.APPROVE_OPTION){
                storeFile(wordFiles.getSelectedFile());
        public void storeDictionary(File dictionaryFile){
            String dictionary="";
         Scanner scanner=null;
        try {
           // Delimiters specifiy where to parse tokens in a scanner
           scanner = new Scanner(dictionaryFile).useDelimiter("\\s*[\\p{Punct}*\\s+]\\s*");
        catch (FileNotFoundException fnfe) {
            JOptionPane.showMessageDialog(this,"Could not open the file");
           System.exit(-1);
         while (scanner.hasNext()) {
              if (!dictionary.equals(""))
                 dict.add(scanner.next());
            System.out.println("Thank you, your dictionary is stored.");
        public void storeFile(File wordFile){
            String word="";
            Scanner scanner2=null;
        try{
            scanner2 = new Scanner(wordFile).useDelimiter("\\s*[\\p{Punct}*\\s+]\\s*");
        catch (FileNotFoundException fnfe){
            JOptionPane.showMessageDialog(this,"Could not open the file");
            System.exit(-1);
            while(scanner2.hasNext()){
                if(!word.equals(""))
                    file.add(scanner2.next());
        public static void main(String args[]){
            spell1 spellck = new spell1();
            spellck.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

  • How to check File size of a Text file.

    How to check File size of a Text file.
    please explain me.
    I am new in LabVIEW. and dont have much idea on this...;
    Prashant Soni
    LabVIEW Engineer
    Solved!
    Go to Solution.

    Hi Prashant,
    and here's what you get when using the LV help...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How to convert text file into xml file format with and check that with DTD

    I have an text file with | seperator . I have to convert this to an xml file and check with DTD present with me..
    plz help me out

    can i get some code that how to compare the xml with dtd or just give the DTD name with an XML

  • Oracle UCM fails to check in text/xml files

    We have an Oracle UCM server that is failing to check in xml files over a certain size - I haven't narrowed down the size limit yet, but a <100kb file will work 100% of the time, while 300+ Kb xml files fail almost all the time, though there has been some success. Image files and zip file succeed on new check ins 100% of the time as well. We have tried with the SOAP API and the UCM new check in form - in both cases we get an empty repsonse from the server. In firefox we get the "The connection was reset" page. I'm at a loss as to explain why, but I have almost no experience with Oracle UCM. This particular server has been running for over a year happily accepting xml files of all sizes, then one day just stopped - as far as I am aware, nobody changed any
    settings/upgraded anything/changed network topology.
    When I look in the server output, I don't really see any indication of failure or find any mention of the file name or content title like I do when a file successfully checks in.
    I have already asked the DBA to drop and rebuild the database index, started the Collection rebuild cycle (it finished successfully) and turned on the webless file store option on the defaultfilestore provider.
    UCS Version : 10.1.3.3.3 (080807) (Build:7.2.2.188)
    Database : Microsoft SQL Server 09.00.4035 currently using DATABASE.METADATA though I think it was at one point using Full text search, but the database was not.
    Java Version:1.6.0
    Please ask if there is any other information you need, but I do not have physical access to the machine, and I may not be able to reveal certain info due to privacy/security concerns.

    Hello,
    I think you should open an SR with support to help out. Be that as it may, here's some observations/suggestions...
    * You are running a 4-year old content server. There have been numerous fixes since then. Your system may have grown to a point where it's hit one of the older issues.
    * Is it possible the XML encoding may have changed? i.e. that whatever generates the XML files is now generating them slightly differently and therefore the encoding is different so check-in doesn't follow the same rules? I'd look at the first line of older files versus the new files which fail. If there's a difference, refer to KM note 978689.1 in our knowledge base.
    * You say there doesn't appear to be anything in the logs, so let's increase them:
    - Login to UCM as Administrator. Go to Administration->System Audit Information. Switch on the Full Verbose Tracing checkbox. In the Active Sections field, put in:
    systemdatabase - this will show you what queries and inserts are made to the database and should show whether there's a problem at that level.
    requestaudit - this shows you the requests as they come in, as well as a roundup of all requests every 2 minutes. If you see large amounts of time being taken on requests, your server could be creaking because of resources.
    publish - tells you about publishing related issues, most XML file check-ins are related to this.
    - Try to check in a file which should fail.
    - Switch off verbose logging (see above) to reduce overhead.
    If the OS is Windows then the <install>/config.cfg file needs to have UseRedirectedOutput=true in order to generate a log file for this tracing. On Windows the file is the <install>/bin/IdcServerNT.log file. (if the above config is set)
    On *nix it is in the <install>/etc/log file (notice that there is no file extension on the file)
    If none of the logs helps you, an SR is probably in order.
    Regards,
    Frank.

  • Read email adress from a text file then check the validity of them

    a text file has three lines, each line contains one email adress:
    [email protected]
    qwe@@ws.com
    wer//@we.net
    read the email address from a text file, then check which one is invalid, output the invalid email adress in the console.

    no 3 .umm, an email adress can have more than 2 '.'s in it,
    example:
    [email protected]
    would be a valid email address.
    To decide what a valid address is you'd need to parse it against the correct standard.
    I think however that javax.mail.internet.InternetAddress does this for you, check out the docs:
    http://java.sun.com/products/javamail/1.2/docs/javadocs/javax/mail/internet/InternetAddress.html
    even if it parses it may not be a valid address though in that it may not actually exist.

  • Reading Text File from selection Screen and populating table (Urgent)

    Hi All,
    I have some requirment like i in my report i have to initial my Input feild from text file is it good to populate a internal table or range.
    I have three feild in a excel file that entry can more then 500
    data example
    Matnr Date             Day
    A1     10.07.2007    12
    B1     10.07.2007    10
    A1     19.07.2007    15
    C1     20.08.2007    30
    E1     11.09.2007    12
    This report for Price Protection claim.
    even u can help me out with proper table plz this is urgent.

    Hi..
    <b>parameters:</b>
      p_file(50) type c.
    <b>data:</b>
      begin of itab occurs 0,
         matnr type vbak-matnr,
         date type sy-datum,
         day(2) type n,
      end of itab.
    <b>at selection-screen on value-request for p_fname.</b>
      perform get_path.
    <b>start-of-selection.</b>
    <b>CALL FUNCTION 'GUI_UPLOAD'</b>
      <b>EXPORTING
        FILENAME                      =  p_fname
       FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = 'X'</b>
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
    <b>  TABLES
        DATA_TAB                      = itab</b>
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      NO_AUTHORITY                  = 6
      UNKNOWN_ERROR                 = 7
      BAD_DATA_FORMAT               = 8
      HEADER_NOT_ALLOWED            = 9
      SEPARATOR_NOT_ALLOWED         = 10
      HEADER_TOO_LONG               = 11
      UNKNOWN_DP_ERROR              = 12
      ACCESS_DENIED                 = 13
      DP_OUT_OF_MEMORY              = 14
      DISK_FULL                     = 15
      DP_TIMEOUT                    = 16
      OTHERS                        = 17
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    This Sub routine is used to get the file name
    *There are no interface parameters passed to this subroutine.
    FORM get_path .
    CALL FUNCTION 'WS_FILENAME_GET'
    EXPORTING
       DEF_FILENAME            =  P_FNAME
      DEF_PATH               = ' '
      MASK                   = ' '
      MODE                   = ' '
      TITLE                  = ' '
    IMPORTING
       FILENAME                =  P_FNAME
      RC                     =
    EXCEPTIONS
       INV_WINSYS             = 1
       NO_BATCH               = 2
       SELECTION_CANCEL       = 3
       SELECTION_ERROR        = 4
       OTHERS                 = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    " get_path
    data:

  • Interactive Bar/pie chart and line graph, data from excel/text file -urgent

    Hi,
    I have a huge data in excell sheet which keeps updating every month. Data basically consists of service provider and there respective subscribers from various regions of the country over the years. The requirement is to give the viewers an interactive page where in they can make various combinations and can compare, cross examine data according to thier choice.
    We want the pie chart / bar graph or line graph to be created on the fly according to the combination made by the user.
    The site is hosted on a red hat linux server. how can a connection to the excel spreadsheet be made or is it possible to read from the text file if the entire data is exported to a text file.
    Is there any ready made tool/code available which can be customised according to the need.
    Thanx in advance
    Regards
    Prakash

    I certainly wouldn't pay for the graphing package at the previous link. check out http://www.object-refinery.com/jfreechart/ for a free, open-source, much better looking graphing package.

  • Added a check to Text to sequence file result in Test Stand hang up.

    I added the check in text to sequence file translator.vi (the file is attached)
    With this addition I generated the dll.
    Test Stand load the sequence file without any problem for the first time.
    If I add a space to the sequence file and save the file; test stand tries to load the new sequence file saying file has changed do you want to load the new sequence...
    But fails to load the sequence (Test Stand hangs up)
    The only way to overcome is kill the TestStand thru task manager.
    Which displays
    "You chose to end the nonresponsive program, SeqEdit.exe"
    Attached the displayed error (error.doc)
    Attachments:
    Changed code.vi ‏55 KB
    Error1.doc ‏45 KB

    Hi Vidula,
    Is it only when you add a space to the file name that you see this behavior? If, for instance, you add a '1' to the beginging of the file name does the same thing happen?
    Adam
    National Instruments
    Applications Engineer

  • How to check authorizations of a text file in windows server while accesing

    hi,
    I have to access a text file from windows server like windows NT/2003 in to SAP server through report program.
    While accessing the file i have to check the authorization of that file access users of windows.And i have to read it into SAP report program.
    Regards,
    Shankar.

    hi,
    Thanks for Immediate reply.
    i have to check this at level of windows login details i.e user name  and file acces permissions to login user.  through abap coding i have to check it  weather the windows login user having authorizations to access that file are not. If he is having authorization to access then that text file has to read in to ABAP report program and it has to be used in program. other wise it has to be raise an error message
    if provide some example with code...it will be very help full to clear my problem.
    Thanks & Regards,
    Shankar.
    Edited by: Shankar  Reddy Chamala on Aug 26, 2008 8:55 AM

Maybe you are looking for