Copy the content of the text file not the file itself

Hi
I have a problem, I am converting .dat file to .txt file using powershell and there is no problem, but when i try to read that file using the software I am working with, it cant read the file. but when i copy and paste it manually to new file, it works.
any suggestions?

You can try something like:
$file=Get-ChildItemC:\Test\Test.dat
Rename-Item -Path
$file
-NewName
test.txt
See if that works
Freddy91761_1

Similar Messages

  • How to read the content of a text file (by character)?

    Guys,
    Good day!
    I'm back just need again your help. Is there anyone knows how to read the content of a text file not by line but by character.
    Please help me. Thank you so much in advance.
    Jojo

    http://java.sun.com/javase/6/docs/api/index.html
    package java.io
    InputStream.read(): int
    Reads the next byte of data from the input stream.
    Implementation:
    InputStreamReader
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes them into characters using a specified charset. The charset that it uses may be specified by name or may be given explicitly, or the platform's default charset may be accepted.

  • How to store the contents of a text file directly in to a clob field

    Hi All,
    Could anyone help me to store the contents of a text file (*.txt,*.xml etc)directly in to a clob field.
    Thanks in advance
    Jayaram.

    One way is to use sqlloader. Three files are used. A control file, an xml data file, and a file with the path of the xml data file. Here's the control file. It reads load.file, which is the file with the path of the xml data file. It names the path ext_path, and inserts the xml into field xml_field.
    CONTENTS OF CONTROL FILE:
    load DATA
    INFILE 'load.file'
    APPEND
    INTO TABLE xml_table
    ( ext_path FILLER CHAR(13),
    "XML_FIELD" LOBFILE(ext_fname) TERMINATED BY EOF
    CONTENTS OF FILE LOAD.FILE:
    /tmp/load.dat
    The xml is in the file /tmp/load.dat.
    null

  • Want to display the contents of a text file in a jsp

    hi
    i am new to jsp, i want to display the contents of a text file in a jsp file ,whenever jsp file is loaded from browser.
    -thanx

    i had come up with the code
    <!-- form.jsp -->
    <%@ page import="java.io.*, java.lang.*" %>
    <%@ page language="java" %>
    <html>
    <head>
    <title>Display</title>
    </head>
    <body>
    <%
    String sample[100];
    String line;
    %>
    <%! int i=0; %>
    <%!File f1 = new File("c:\\file.txt"); %>
    <% try { %>
    <%!FileReader fi = new FileReader(f1); %>
    <% } catch(FileNotFoundException io) { } %>
    <%!BufferedReader in = new BufferedReader(fi); %>
    <%
    while((line=in.readLine())!= null)
    sample= line;
    i++;
    in.close();
    %>
    i will display sample here
    </body>
    </html>
    but i am getting error
    display_jsp.java:16: unreported exception java.io.FileNotFoundException;
    must be caught or declared to be thrown
    FileReader fi = new FileReader(f1);
    ^
    plz help
    -thanx

  • Displaying contents of a text file in a text box

    As the topic describes, I need to display the contents of a
    text file in a text box. How would one go about doing this? Thanks
    in advance.

    // setting up the text format options
    var FileFormat:TextFormat = new TextFormat ();
    FileFormat.font = "Verdana";
    FileFormat.size = 12;
    FileFormat.align = "left";
    FileFormat.color = 0xFFFFFF;
    /// load in text from folder load_in , filename is text.txt
    var my_lv:LoadVars = new LoadVars();
    my_lv.onLoad = function (success:Boolean):Void{
    if (success){
    textfield.text = this.txtVarLoaded;
    textfield.setTextFormat ( FileFormat );
    } else {
    trace ("error");
    my_lv.load ("load_in/text.txt"); // load in text.txt
    peace ;o)

  • How to convert content of a Text file to String?

    Hi,
    I need to read the content of a text file and convert it into String and display it on to a JSP file.
    But the codings below don't work. Please advise me on how can i display the text file content.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    File adCheck = new File("list.txt");
    fis = new FileInputStream(adCheck);
    int Length = adCheck.length();
    byte arr[] = new byte[Length];
    int dataRead = 0;
    int totalData = 0;
    while(totalData <Length)
         dataRead = fis.read(arr,totalData,Length);
         totalData += dataRead;
    String Content = new String(arr);//byte array converted to String
    arr = null;

    Take a BufferReader:
    BufferedReader read = new BufferedReader(new FileReader("c:\test.txt");
    String temp = read.readln();
    You can make loops etc. Adding new Strings to an ArrayList,
    adding Strings etc....

  • I want to read the content of a text file dropped in a watched folder into a string variable

    I have a workbench process with 2 variable.
    inDoc (DataType=Document/input/required)
    outStr (DataType = String/output)
    The document being passed to the workflow is a text file with 4 lines of text in it.  when the text file is dropped into the watched folder, it will be assigned to the inDoc parameter in the workflow.
    My workflow needs to extract the 4 lines of text and write it into a string (outStr).
    Id like to use the FileUtilsService.ReadString service but i can't since its input parameter is the file path.  When i do, i get the following error...
    Caused by: ALC-FUT-001-011: File rO0ABXNyABZjb20uYWRvYmUuaWRwLkRvY3VtZW50yAEFUxsO+CEDACNJAAtfY2FsbGJhY2tJZFoADV9kZXNlcmlhb Gl6ZWRJABBfZGlzcG9zYWxUaW1lb3V0WgAJX2Rpc3Bvc2VkWgAZX2lzRGlzcG9zYWxUaW1lb3V0RGVmYXVsdFoAE19 pc1RyYW5zYWN0aW9uQm91bmRKAAdfbGVuZ3RoSQAOX21heElubGluZVNpemVaAAhfb3duRmlsZVoAC19wYXNzaXZhd GVkWgALX3BlcnNpc3RlbnRJABFfc2VuZGVyQ2FsbGJhY2tJZFoAEV9zZW5kZXJQYXNzaXZhdGVkWgARX3NlbmRlclB lcnNpc3RlbnRJAA5fc2VuZGVyVmVyc2lvbkkABl9zdGF0ZUwAC19hdHRyaWJ1dGVzdAATTGphdmEvdXRpbC9IYXNoT WFwO0wACF9jYWNoZUlkdAAfTGNvbS9hZG9iZS9pZHAvRG9jdW1lbnRDYWNoZUlEO0wADF9jYWxsYmFja1JlZnQAIUx jb20vYWRvYmUvaWRwL0lEb2N1bWVudENhbGxiYWNrO0wADF9jb250ZW50VHlwZXQAEkxqYXZhL2xhbmcvU3RyaW5nO 0wAC19kYXRhQnVmZmVydAAeTGNvbS9hZG9iZS9zZXJ2aWNlL0RhdGFCdWZmZXI7TAAPX2V4cGlyYXRpb25UaW1ldAA QTGphdmEvbGFuZy9Mb25nO0wABV9maWxldAAOTGphdmEvaW8vRmlsZTtMABBfZ2xvYmFsQmFja2VuZElkdAAhTGNvb S9hZG9iZS9pZHAvRG9jdW1lbnRCYWNrZW5kSUQ7WwAHX2lubGluZXQAAltCTAAMX2lucHV0U3RyZWFtdAAVTGphdmE vaW8vSW5wdXRTdHJlYW07TAAPX2xvY2FsQmFja2VuZElkcQB+AAhMAAxfcHVsbFN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yfDE4fDIwMTJ8MDN8MDN8MjM0fGFzZGZ8fGFzZGZhc3x8fHxFeGNoYW5nZS1Qcm8uO S40MDEuRnVsbC5XSU4uZW5fQ0EuRU5VLTEwLTIwMTF8DQoNCnBwdwYAAAAAAAB0AAp0ZXh0L3BsYWlucHNyABFqYXZ hLnV0aWwuSGFzaE1hcAUH2sHDFmDRAwACRgAKbG9hZEZhY3RvckkACXRocmVzaG9sZHhwP0AAAAAAAAx3CAAAABAAA AADdAAKd3NmaWxlbmFtZXQAJ0M6XFVzZXJzXENodWxseS5QYXJrXERlc2t0b3BcaGRzY2FuLnR4dHQACGJhc2VuYW1 ldAAKaGRzY2FuLnR4dHQABGZpbGVxAH4AFXh3NwAtYWRvYmUvaWRwL0RvY3VtZW50UHVsbFNlcnZhbnQvYWRvYmVqY l9MQ19ERVYx//////////94 does not exist.
    at com.adobe.livecycle.fileutils.FileUtilsService.readDocument(FileUtilsService.java:363)
    which is what i expected...
    I've also tried with the Script.executeScript to call some java code but im not too strong in java and in all the examples i find, the file pointer requires a file path.
    import java.io.*;
    FileInputStream f = new FileInputStream(patExecContext.getProcessDataValue("/process_data/inDoc"));
    OR
    File f = new File(patExecContext.getProcessDataValue("/process_data/inDoc"));
    OR
    File f = patExecContext.getProcessDataValue("/process_data/inDoc");
    Any clue how to resolve my problem?

    Try the following code snippet to read the String content from the file recieved through watched folder endpoint.
    com.adobe.idp.Document inputDoc = patExecContext.getProcessDataDocumentValue("/process_data/inDoc");
    java.io.InputStream inStream = inputDoc.getInputStream();
    byte[] dataBuffer = new byte[inStream.available()];
    inStream.read(dataBuffer);
    String strData = new String(dataBuffer);
    patExecContext.setProcessDataStringValue("/process_data/outStr",strData);
    The code is not tested, hence if you find any mistakes, correct and test the functionality.
    Nith

  • How to check the content in a text file line

    hi all,
    i had the following problem:
    There is a text file with multiple lines of data in it
    The data comprises of characters, numbers and symbols
    In this file, any line can be commented (till the end) by using symbol ';'(semi-colon)
    Now i have to find the number of occurences of a symbol '$' in this data, such that
    it should not exist in a commented line
    One more limitation is that ';' (semi-colon) could occur at any position in a line, i.e., if this occured in the middle of the line, then all the following data in the line is taken to be as commented one and we have to skip it and move to next line.
    Plz do help.
    Regards,
    santosh
    Regards,
    santosh

    Hi santosh,
    just a guess this is what you need.
    Greets, Dave
    Message Edited by daveTW on 09-15-2006 09:59 AM
    Greets, Dave
    Attachments:
    search & count $.vi ‏13 KB
    search & count $.png ‏10 KB

  • How to read the contents of a text file and populate the data in a table ?

    Hello All,
      Can anyone advise on how to acheieve the above ? I am trying to read in a text file (CSV) and have the contents populated to the respective UI elements in a table. Any help is greatly appreciated.
    from
    Kwok Wei

    Hi,
    Let us consider you have list of names(Seperated by delimeter) in a text file and you want to display in  a table.
    1. Create Context Node "Names" and context attribute "Name"
    2. Create Table and bind to the above context.
    3.Write the following code in the "Init method.
    try{
    FileReader f =new FileReader("");
    BufferedReader r=new BufferedReader(f);
    String names=r.readLine();
    Vector Names=new Vector();
    // Use Tokenizer and store all the names i a vector//
    for(int i=0;i<Names.size();i++){
    IPrivate<<VieName>>.INameElement ele=wdContext.createNameElement();
    ele.set<<Name>>( Names.get(i).toString());
    wdContext.NodeName().addElement(ele);
    Regards, Anilkumar
    Message was edited by: Anilkumar Vippagunta

  • How to modify the contents of a text file stored along with a midlet

    Hi,
    I have been developing a application in j2me wherein i need to first read the contents of the text file stored along with the midlet and later erase the existing content and update it with some text.
    I was able to read the file in the following manner
    InputStream is = getClass().getResourceAsStream("myfile.txt");
    Now i need to erase the contents and then update it the new content, how do i do it. Kinldy please help me out. It is very urgent.
    Thanks

    Didn't you hear me the first time?
    http://forum.java.sun.com/thread.jspa?threadID=701360&messageID=4068435#4068435

  • Display the content of a text file in a browser

    I am new to servlet, I have written a java servlet code which can read a file and display its content in command prompt only(resin),i would like to ask how can i display the content on the browser and i also want to ask how to write a servlet which can display the conetent from a web browser( e.g. whatever i type in a form) and produce the result in the text file.
    import java.io.FileReader;
    import java.io.IOException;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class read extends HttpServlet
    public void doGet (HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException
    String applicationPath =
         getServletContext().getRealPath ("");
    String filePath =
         getServletContext().getRealPath ("/WEB-INF/text.txt");
    FileReader fr = new FileReader (filePath);
    for (int chr = fr.read(); chr != -1; chr = fr.read())
    System.out.print ((char) chr);
    }

    You have to create an object of PrintWriter and use that to display the output on the browser.
    PrintWriter out = response.getWriter();
    out.println(chr);
    Hope this helps..
    Arun

  • Nano3rdgen Copying playlist from itunes to ipod and it says it can't copy certain songs to ipod cos of file type.These problem songs all from same album, all ACC file type and all copied fine when I copied the album itself few weeks ago-help!

    When copying playlist from itunes to nano3rd message comes saying 9 of songs can't be copied to ipod cos of file type. These 9 are all from same album, all ACC and all copied fine when I copied the album itselm some weeks ago.  Rest of playlist was ACC too.  P.S. album is a CD-R copied version-is this an issue? HELP I AM DESPAIRING!

    I never laughed in all my life. Here I was, inserting the cd Dance with Me, thinking it's not going to copy the whole thing. yeah, right.
    Sure, it prompted me, Do I want to replace the songs, so of course I said "no, don't replace the songs". and guess what it did. It copied the whole cd (at least I got my two songs).
    I went into the itunes library, and sure enough, all the songs were there twice. So what did my intelligent brain think of? I just unchecked the doubled songs and stuck my ipod into my computer and it synched up and I got what I wanted.
    Now what did I do wrong when it prompted me. I clicked on "don't replace" and it replaced them anyway.
    Am I dumb? or is itunes stupid?
    thanks, Melody

  • Comparing contents of two text files

    I know that I can copy all contents of the two files into two strings, and then do str1.equals(str2). Any better way to do it?

    What kind of comparison do you want to do?
    - Exact - the files must have the same size, and have the same bytes, like "fc /b" in Windows
    The exact comparison is very easy to do: open the files as FileInputStreams and read both using byte buffers. Compare the byte buffers.
    If you can't open both files at the same time (for instance, one of the files is in a diskette and the other file is in another diskette, and you have only one diskette drive) you could try checking the digest of the files (java.security.MessageDigest). If the digest values match, probably the files are equal. If the digest values don't match, certainly the files are different.
    - Textual - you want to find differences between the files, and pinpoint them, like the "diff" command in Unix, or the "fc" command in Windows.
    Textual comparison is not easy to do (you'll need to keep lists of matching lines, and figure out if some sequence of lines was moved, changed etc.); but you can find the source code for it in several places.

  • How to compare content of two text file using StreamTokenizer

    hi....
    i have two text files...containg field like(name,number,scheme) and(number,date,value)... i want to create a third file containg field like (name,number,date,scheme,value) by using these two table. how to create

    I think this code can solve your problem.
    private static final String DELIM = ",";
    * Compile two files.
    * @param file1 String the input file 1
    * @param file2 String the input file 2
    * @param file3 String the output file
    * @throws IOException error in reading/writing
    public void compileFiles(String file1, String file2, String file3) throws
            IOException {
            BufferedReader reader1 = new BufferedReader(new InputStreamReader(
                new FileInputStream(file1)));
            BufferedReader reader2 = new BufferedReader(new InputStreamReader(
                new FileInputStream(file2)));
            BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(
                new FileOutputStream(file3)));
            String line1 = reader1.readLine();
            String line2 = reader2.readLine();
            while (line1 != null && line2 != null) {
                writer.write(compileLines(line1, line2));
                writer.newLine();
                line1 = reader1.readLine();
                line2 = reader2.readLine();
            reader1.close();
            reader2.close();
            writer.close();
        private String compileLines(String line1, String line2) {
            StringTokenizer tok1 = new StringTokenizer(line1, DELIM);
            StringTokenizer tok2 = new StringTokenizer(line2, DELIM);
            String name = tok1.nextToken();
            String number = tok1.nextToken();
            String scheme = tok1.nextToken();
            // ignore number
            tok2.nextToken();
            String date = tok2.nextToken();
            String value = tok2.nextToken();
            StringBuffer buffer = new StringBuffer();
            buffer.append(name);
            buffer.append(DELIM);
            buffer.append(number);
            buffer.append(DELIM);
            buffer.append(date);
            buffer.append(DELIM);
            buffer.append(scheme);
            buffer.append(DELIM);
            buffer.append(value);
            return buffer.toString();
        }

  • How to display the contents of a text file on the command line?

    I realize I need to utilize classes from the java.io.* package, but I don't know which ones to use exactly. This is what I would like to do in a nutshell:
    public static void main(String[] args) throws IOException {
    File inputFile = new File( <path to the file>);
    // code that reads data from the above file and is able to
    // append it to  a string object or display it on the command
    // line (System.out.println)
    }Thanks for your time!

    It's pretty easy. Here's a little example that reads a file, stores it in a string, and prints it to the command line.
    import java.io.*;
    public class OpenFile {
         public static void main(String args[]) {
              try {
                   File fileToOpen = new File("something.txt");
                   FileReader fileIn = new FileReader(fileToOpen);
                   BufferedReader br = new BufferedReader(fileIn);
                   String fileContent = new String();
                   String line;
                   while ((line = br.readLine()) != null) {
                        fileContent += line + "\n";
                   System.out.println(fileContent);
                   br.close();
              catch (IOException e) {
                   System.out.println("Exception: " + e);
    }Good luck,
    Alex

  • TREX/Content Server: Full text searches not working

    I've setup TREX and Content Server in a sandbox environment and have been trying to get my head around DMS.  I've completed what I've believed are the required steps (outlined below) and I have submitted 12 documents of various types into the respository.  I'm able to perform meta data searches but not full text searched.  Any ideas what I might have missed?
    Much thanks!!!!
    /Greg
    0. Defined connection to TREX Server: TREX_42 (SM59); Using TREXADMIN all services are green.
    1. "Define Document Area" - DMS is present; assumed I would use this one.
    2. "Defined Indexing Readiness" - selected "Index Release" & "Classify" for DMS; set "Search Srv" to DMS_TEST
    3. "Define Content Respository" - Created Z_CR_001 and maintained it as follows:
      - Documentation Area: Document Management System
      - Storage Type: HTTP content server
      - HTTP Server:  srv-sptxd2-dal.intervoice.int  (content server)
      - Port: 1090
      - HTTP Script: ContentServer/ContentServer.dll
      - Physical Path: /usr/sap/IRD/SYS/global/
    4. "Define Content Categories" - Created ZCSSTRUCT; maintained as follows:
      - Document Area: DMS
      - Content Rep: Z_CR_001
    5. Checked CSADMIN for Z_CR_001 - All Green
    6. Went into SKPR07 (monitoring tab); entered DMS_PCD1 and "Indexing possible", "Auto indexing" and "DocArea activated" is all green.
    7. Went into SMRO
      - created SSR: "Search Server ID" = DMS_TEST, "Search engine" = DRFUZZY
      - Verified "RFC Destinations"; passed tests; all green.
    8. Went into SKPR07; using DMS_PCD1 as document class. 
      - executed "Clean up table entries"
      - deselected "Limited to selected language"
      - executed reindex. "Copied successfully from search engine"
      - Selected the created index category
      - Set the "Document area" indicator
      - execute "Trigger process"; 12 documents referenced
    9.  Going into TREXADMIN I can see the created index; however the document count = 0.  Also there is no queue created -- should there be?
    Edited by: Greg Preston on Aug 5, 2009 9:11 PM

    Dear
    this link will help you,
    TREX Architecture
    http://help.sap.com/saphelp_erp60_sp/helpdata/EN/71/b26b2bfdc4eb47ab5432e8444290ce/content.htm
    File Formats Supported by TREX
    http://help.sap.com/saphelp_erp60_sp/helpdata/EN/55/cb634114b78047e10000000a1550b0/content.htm
    Detail about TREX Configuration  (Basic to advance)
    http://help.sap.com/saphelp_erp60_sp/helpdata/EN/46/bab1d48b0a1514e10000000a114a6b/content.htm
    Regards
    Tushar Dave
    Edited by: Tushar Dave on Aug 6, 2009 9:59 AM

Maybe you are looking for

  • Why are my slideshow images showing as low res?

    I'm creating a site that will show a housing development in the works, and with each lot number that's clicked on the home page, the link goes to a page with a slideshow (My Albums) and when that is clicked you're taken to a new page with separate sl

  • Webmail and Mime

    We are experiencing a problem with our Webmail. version: Server ESMTP (iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8 2003) I have opened a ticket with Sun, but do not have resolution yet. When someone in webmail replies to a HTML message that

  • How to change us store to uk store..

    Anyone knows how??

  • How do I unzip a mail attachment?

    Received an email attachment that is zipped, and instructed to open it with Archive Utility. For some reason I cannot open it, or if it is open, find it.

  • IPhoto  Application

    Apparently my iPhoto Application seems to be nowhere found in my computer. It states under Finder: Applications - 'You can not open the application iPhoto.app because it is not supported on this architecture." Meanwhile, with my remote, I can click t