Problem in Using a Text file

Hello,
I want to read my text from a text file and it�s not a predetermined text, what i want to do is read the records in the form of text and i want to use "," as the delimiter between each Column in my Output file.
I was trying to do this but somehow am not Achieving anything meaningful till now.
Waiting for positive Reply�s from the Forum Memebers.

The solution has already been suggested on this thread.
http://forum.java.sun.com/thread.jspa?threadID=686118
If you didn't get it, here are the steps again:
1. Read the file using java io http://java.sun.com/docs/books/tutorial/essential/io/
2. As you read each line, use StringTokenizer or String.split() to separate each value.
You do not need to have a predetermined text. The only predetermined thing is your delimiter.
x

Similar Messages

  • Importing schema+ data using a text file containing sql commands

    I have the 2012 SQL SVR Mgmt Studio installed. I received a file--snippet below... from an export of our current DB provider, Advantage. I know I have to edit a lot of commands, but my question is quite simple--how do I use a text file with commands in it
    like below to create tables, columns and load data into SQL SVR.
    ---data.txt file contents----
    -- Table Type of Beneficiary is ADT
    Create Table Beneficiary(
       PlanId Char( 9 ),
       Hash Integer,
       Line1 Char( 128 ),
       Line2 Char( 128 ),
       Batch Char( 16 ) );
    EXECUTE PROCEDURE sp_CreateIndex90( 'Beneficiary', 'LAC_LACV1_Beneficiary.adi', 'KEY1', 'Hash;PlanId', '', 2051, 4096, NULL );
    INSERT INTO "Beneficiary" VALUES( 'LACV1', 983, 'Judith Pursifull~Spouse~100~~~', 'Michael Pursifull~Son~50~Thomas Pursifull~Son~50', '761011042' );
    INSERT INTO "Beneficiary" VALUES( 'LACV1', 996, 'Anna Brownlow~Spouse~100~~~', 'Kaitlin Brownlow~Daughter~85~Lawanda Brownlow~Mother~15', '49036615' );
    INSERT INTO "Beneficiary" VALUES( 'LACV1', 1005, 'Weldon Shelton~Other~50~Star Shelton~Other~50', 'Danica Shelton~Sister~50~Ryan Shelton~brother~50', '109075816' );
    INSERT INTO "Beneficiary" VALUES( 'LACV1', 1031, 'Donald D Duffy~Spouse~100~~~', 'Brandon M Duffy~Son~100~~~', '219979254' );
    INSERT INTO "Beneficiary" VALUES( 'LACV1', 1063, 'Lynne Roffino~Other~50~John Roffino~Other~50', 'Katy Roffino~Sister~50~Margaret Roffino~Sister~50', '604232358' );
    INSERT INTO "Beneficiary" VALUES( 'LACV1', 1062, 'John Teaven Redstone~Spouse~100~~~', '~~~~~', '482024691' );
    INSERT INTO "Beneficiary" VALUES( 'LACV1', 1032, 'Judith Anne Brown (for cat care)~Other~50~Judith Ann (Kappler) Barklage~Other~50', 'LaVerne Cocke (for cat care)~Friend-PantegoBibl~50~~~', '358324107' );
    -- Table Type of Date is ADT
    Create Table Date(
       Hash Integer,
       PlanId Char( 9 ),
       Type Char( 24 ),
       Date Date,
       Override Logical,
       Batch Char( 32 ) );
    EXECUTE PROCEDURE sp_CreateIndex90( 'Date', 'LAC_LACV1_Date.adi', 'KEY1', 'Hash;Date;PlanId;Type', '', 2051, 4096, NULL );
    INSERT INTO "Date" VALUES( 1018, 'LACV1', 'HARDSHIPEND', '2010-02-20', False, '20090820-9414719' );
    INSERT INTO "Date" VALUES( 1018, 'LACV1', 'HARDSHIPSTART', '2009-08-20', False, '20090820-9414719' );
    INSERT INTO "Date" VALUES( 1001, 'LACV1', 'HARDSHIPEND', '2010-02-06', False, '20090806-9371968' );
    INSERT INTO "Date" VALUES( 1001, 'LACV1', 'HARDSHIPSTART', '2009-08-06', False, '20090806-9371968' );
    INSERT INTO "Date" VALUES( 1022, 'LACV1', 'LUMPSUMDISTRIBUTION', '2009-07-21', False, '20090721-9337640' );
    charles.leggette

    from an export of our current DB provider, Advantage.....
    -- Table Type of Date is ADT
    Create Table Date(
       Hash Integer,
       PlanId Char( 9 ),
       Type Char( 24 ),
       Date Date,
       Override Logical,
       Batch Char( 32 ) );
    Hello Charles,
    The SQL Syntax especially for DDL commands are different between MS SQL Server and Advantage Database, so you have to modify them to get them work.
    As David already wrote we don't have a stored procedure "sp_CreateIndex90" in SQL Server, you may remove these commands, and we also don't have a data type "Logical", next could be "bit"
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Problem while reading from text file using JDeveloper 10.1.2

    Hi,
    I am using JDeveloper 10.1.2 for my application. In this, I have one requirement to read some data from a text file. For that, I created a test file and saved along with the java file folder. From there, I am trying to read this file but it says the file not found exception.
    Application is looking the file from another location. "F:\DevSuiteHome_1\jdev\system10.1.2.1.0.1913\oc4j-config"
    But, I want to read it from my home folder. How is it possible to read from that location?
    Regards,
    Joby Joseph

    HI,
    Check followings will useful
    How to read .txt file from adfLib jar at model layer using relative path
    Accessing physical/relative path from Bean

  • Help with 2D array input using a text file

    I'm writing a JAva program using BlueJ, which requires me to read info from a text file and put them into an 2D array. I got this error msg and I couldn't gifure out how to fix it. Please help me. Thanks a lot. The program is due tomorrow, please help.
    Error message:
    NoSuchElementException:
    null(in Java.util.StringTokenizer)
    Here's the program with the line where the problem is highlighted
    import java.io.*;
    import java.util.StringTokenizer;
    public class ***
    // Reads students' test scores from a file and calculate their final grade
    public static void main (String[] args) throws IOException
    String file1 = "C:/Temp/scores.txt";
    int[][] input = new int[25][5];
    StringTokenizer tokenizer;
    String line;
    FileReader fr = new FileReader (file1);
    BufferedReader inFile = new BufferedReader (fr);
    line = inFile.readLine();
    tokenizer = new StringTokenizer (line);
    for (int row = 0; row < 25; row++)
    for (int col = 0; col < 5; col++)
    input[row][col] = Integer.parseInt(tokenizer.nextToken()); --> porblem
    This is what the text file looks like:
    1 74 85 98
    2 97 76 92
    3 87 86 77
    4 73 85 93
    5 99 99 83
    6 82 84 95
    7 78 83 91
    8 84 79 84
    9 83 77 90
    10 75 78 87
    11 98 79 92
    12 70 73 95
    13 69 80 88
    14 81 77 93
    15 86 72 80
    16 70 76 89
    17 71 71 96
    18 97 81 89
    19 82 90 96
    20 95 85 95
    21 91 82 88
    22 72 94 94

    Try this code..(I've tested this code in my machine and it works fine)
              try {
                   FileReader fileReader = new FileReader("Z:\\fileInput.txt");
                   BufferedReader reader = new BufferedReader(fileReader);
                   int[][] fileData = new int[22][4];
                   StringTokenizer tokenizer = null;
                   String line = reader.readLine();
                   int rowCount = 0;
                   while(line != null) {
                        tokenizer = new StringTokenizer(line, " ");
                        int columnCount = 0;
                        while(tokenizer.hasMoreTokens()) {
                             fileData[rowCount][columnCount] = Integer.valueOf(tokenizer.nextToken()).intValue();
                             columnCount++;
                        line = reader.readLine();
                        rowCount++;
                   fileReader.close();
                   System.out.println("Done");
              } catch (FileNotFoundException fnfe) {
                   System.out.println("File not found " + fnfe);
              } catch (IOException ioe) {
                   System.out.println("IO Exception " + ioe);
    The problem with your code is that you should first check whether there are any tokens before doing nextToken().
    -Amit

  • Using a text file to make a query

    Hello and sorry to disturb.. but as a newbie I hope to find solution to my problem...
    My users produce a text file that contains for each line an id (primary key).
    My goal is to let them easily use that file as a part of a query that I define. e.g. they provide that list and the interface outputs the values related to those ids.
    I read that is easy to import a file but I haven't understood how I can transform it's content in a query. Or maybe I can create a text field where the user can paste this list but I think that there's the limit of 30kb ...
    Thanks in advance for any answer!
    Simone

    Thanks Vikas for your answer,
    I already looked on the forum searching for all those sub-topics. The only thing that I'm not yet capable is to parse the blob content.. I'm lookin into the forum but I'm not finding what I need.. if you could gently give me the link to the right discussion I'd really apprecciate.
    Thanks in advance

  • Exit labview (executables) after using large text files

    Hello,
    I am using LabView 6.0 and his aplication builder / runtime engine. I wrote some VI`s to convert large Tab delimited textfiles (up to 50 mb). When I am finished with the file it is staying in the memory somehow and is staggered with other (text)files in such a way the computer is slowing down.
    When I want to exit the VI (program) it will take a very long time to get  lost of the program (resetting LabView) and get my speed back.
    How kan I solve this problem for these large files?
    Martin.

    OK, this may be a bit of a problem to track down, but let's start.
    First, while your front panel looks great, your code is very hard to read. Overlapping elements, multiple nested structures and a liberal use of locals make this a problem. My first suggestion would be to with a massive cleanup operation. Make more room, make wires straight, make sure things are going left-to-right, make subVIs, place some documentation and so on. You won't believe the difference this makes.
    After you did that, we can turn to find the problems. Some likely suspects are the local variables and the array functions. You use many local variables and perform resizing operations which are certain to generate copies. If you do this on arrays with dozens of MBs of data, this looks like the most likely source of the problem. Some suggestions to deal with this - if you have repeating code, make subVIs or move the code outside of the structures, so that it only has to be run once. Also, you seem to have some redundant code. For instance, you open  the file only to see if you get an error. You should be able to do this with the VIs in the advanced palette without opening it (and you won't need to close it, either). Another example - you check the exit conditions in many places in your code. If your loop runs fast enough, there is no need for it. Some more suggestions - use shift registers instead of locals and avoid setting the same properties over and over again in the loop.
    After you do these, it will probably be much easier to find the problem.
    To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
    In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).
    And one last thing - having the VI run automatically and then use the Quit VI at the end is not very nice. Since you are building it, it will run automatically on its own and you can use the Application>>Kind property to quit only if it's an executable.
    Try to take over the world!

  • Search and replace data in excel using a text file

    Hi Scripting Guy:
    I was able to write a script based on all the examples in your blogs, but now I'm stuck:
    I have a text file, which has Server Name, IP Address, Comments
    ABCserver1, 1.1.1.1, remote web server
    DEFserver2, 2.2.2.2, remote app server
    XYZserver3, 3.3.3.3, remote api server
    I have a excel file which has Server Name, IP Address, Protocol, Port. Server Name, and IP Addreess can repeat itself more than once in entire spreadsheet at any location: 
    Server1, x.x.x.x, TCP, 80
    Server2, x.x.x.x, TCP, 80
    Server3, x.x.x.x, TCP, 80
    My script search for the excel spreadsheet for a array that I have defined [Server1,Server2,Server3,...], once the first value matches in spreadsheet it replaces all values of Server1 with first value in text file i.e: ABCServer1 so my new excel sheet looks
    this:
    ABCserver1, x.x.x.x, TCP, 80
    DEFserver2, x.x.x.x, TCP, 80
    XYZserver3, x.x.x.x, TCP, 80
    What I also want is, when I replaces the "Server1" value in spreadsheet, it will also replace the IP Address in next column. This is where I'm stuck I can replace the value of Server Name, but I can't replace the IP address for text file. Remember
    "Server1" can be found at any place in spreadsheet but it will always have IP address column next to it.
    So this is what script will do if runs correctly:
    1) Read text file:
    ABCserver1, 1.1.1.1, remote web server
    DEFserver2, 2.2.2.2, remote app server
    XYZserver3, 3.3.3.3, remote api server
    2) Before script run on excel sheet
    Server1, x.x.x.x, TCP, 80
    Server2, x.x.x.x, TCP, 80
    Server3, x.x.x.x, TCP, 80
    3) After script run on excel sheet
    ABCserver1, 1.1.1.1, TCP, 80
    DEFserver2, 2.2.2.2, TCP, 80
    XYZserver3, 3.3.3.3, TCP, 80
    If you will see my script is able to replace "Server Name" in entire spreadsheet, but can't copy or replace the corespondent IP address in next column. 
    script:
    $text = "Server1","Server2","Server3"
    $replace=$replace = get-content C:\script\test.txt | foreach{ ($_.split(","))[0]}
    $File = "C:\script\test.xlsx"
    $now = [datetime]::now.ToString("yyyy-MM-dd")
    #$now = get-date -Format "MM-dd-yyyy_hh:mm:ss"
    copy-Item C:\script\test.xlsx test_$now.xlsx
    # Setup Excel, open $File and set the the first worksheet
    $i=0
    $Excel = New-Object -ComObject Excel.Application
    $Excel.visible = $true
    $Workbook = $Excel.workbooks.open($file)
    $Worksheets = $Workbooks.worksheets
    $Worksheet = $Workbook.Worksheets.Item(1)
    $Range = $Worksheet.UsedRange
    Foreach($SearchString in $text){
    if ($Range.find("$SearchString")) {
        $Range.replace($SearchString,$replace[$i])
    else {$i++}
    $WorkBook.Save()
    $WorkBook.Close()
    [void]$excel.quit()
    Really appreciate your help
    Thanks

    Hey, thanks for helping me out. I checked online and I had to call Cells this way:
    $Workbook.Worksheets.Item(1).Cells.item($cell.Row,$cell.Column+1)=$test[$i].replace
    one problem I'm having is if the $server value repeats itself in excel sheet again it doesn't replace all values for lets see server 1:
    so thats how my excel sheet is:
    server1
    x
    TCP
    80
    server2
    x
    TCP
    80
    server3
    x
    TCP
    80
    server1
    x
    TCP
    80
    when I run the script thats how results looks:
    server1
    x
    TCP
    80
    REM88888SQL301A
    10.1.1.2
    TCP
    80
    REM88888SQL301B
    10.1.1.3
    TCP
    80
    REM88888SQL301
    10.1.1.1
    TCP
    80
    It skipped the line one on excel and changed value in line 4. As I mentioned above this can repeat $server can repeat itself anywhere in spreadsheet in multiple columns.
    What can we do so it will replace all server name and IP address?
    Thanks

  • How to Test, Inbound idoc ,with out the Sender System, using a Text File

    Hi Guru's .
    we wanted to test BLAORD03 inbound idoc (Message Type BLAORD).with out the SENDER SYSTEM.
    on the same client.
    we wanted to test this idoc with text file from our local machine.
    Can anyone give us detail steps.like how to create  File layout
    with Segment name,and values for the fields.how to pass this file to the system.
    Thanks in advance.

    Hi Aparna.
    My requirement is to test the idoc with Inbound File.
    Generate a file with the data entered through segments through we19 ,and use the same file for processing through we16.
    when i am trying to do this syst complaing about
    Partner Profile not available, and some times
    port not available. and some  times with
    'No further processing defined'.
    but i maintained part profiles and port perfectly.
    Can you help me in testing with test 'File' port.

  • AxWindowsMediaPlayer problem with using subtitle sami.file in winform

    Hello every body
    I have a problem with using sami caption in axWindowsMediaPlayer;
    how can I use it?
    I used
    axWindowsMediaPlayer1.closedCaption.SAMIFileName="FileNameAddress";
    and
    axWindowsMediaPlayer1.ShowPropertyPages();//and select sami file
    but in both ways the subtitle is not shown in my axWindowsMediaPlayer1 control;
    please help me for solving this problem

    Hi ,
    As i know the Synchronized Accessible Media Interchange (SAMI) file must use an .smi or .sami file name extension.
    set the smi-file direclty like following
    AxWindowsMediaPlayer.closedCaption.SAMIFileName = "subtitles.smi";
    Please also refer here
    for more details.
    Follow the steps below for your Windows Media Player to display captions and subtitles.
    http://support.3playmedia.com/entries/21934486-windows-media-files-windows-media-player-settings
    Related thread, please note the Style secttion.
    http://answers.microsoft.com/en-us/windows/forum/windows_7-pictures/wmp-12-doesnt-play-sami-files-closed-captions/96fe98b7-1cdf-41f5-aa9e-a4e55fd07c0a
    In addition, Could you please provide your smi or sami file and full code? It could be better to help us do some test on my side.
    Have a nice day!
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Problem with CS3 InCopy text files and InDesign CS5

    I have a large annual magazine that I am developing. There is one section that doesn't change much from year to year and I was hoping to grandfather in the InCopy text files from last year's edition. I've successfully used this strategy the past few years without issue. However, now when I try to check out those text files from last year, I receive the following message "This story needs to be coverted to "InCopy Document" format in order to edit it."
    I am running both InDesign CS5 and InCopy CS5 in SL 10.6.4. The previous year's magazine document was in CS3 InDesign format and the text files were in InCopy CS3. Is there some sort of compatibility issue? Is there a specific method for converting them so I can check them out in InDesign? I haven't attempted to check them out in InCopy CS5 yet but I will try that next. But I really need the ability to check out the content via InDesign too.
    Thanks in advance.
    Robert

    AFAIK, you're going to actually need to open the INCX files in InCopy and then resave them as ICML file. You can then relink them all in InDesign.
    Other choice is killing the InCopy links and then relinking everything.
    Best practice would be to finish any job started in CS3 with CS3 and then move to CS5 with new projects.
    Bob

  • Using a text file to provide paths for copy-item

    OK, please don't beat me over the head too much for this.  I've been trying various methods all day and nothing seems to be working.  I have a text file that has a list of folders (full paths including drive letters).  I want to copy all of
    the folders and their contents to another path.  The destination path does not change (d:\temp\destination) but each of the folders in the text file should end up being subfolders of the destination
    Sources:
    d:\source1 (has file01.txt, file02.txt)
    d:\source2 (has file03.txt, file04.txt)
    Destination
    d:\temp\destination
    Should end up with something like
    d:\temp\destination\source1\file01.txt
    d:\temp\destination\source1\file02.txt
    d:\temp\destination\source2\file03.txt
    d:\temp\destination\source2\file04.txt
    I've tried
    Copy-Item -Path D:\Temp\paths.txt -Destination D:\Temp\attachments -recurse -Force
    which just copies the file that contains my paths.
    I've tried
    foreach($line in (Get-Content -Path D:\Temp\paths.txt)){$dest_folder="D:\Temp\destination" | Copy-Item -path $line -destination $dest_folder -force -recurse}
    I get an error that says
    Copy-Item : The input object cannot be bound to any parameters for the command either because the command does not take
     pipeline input or the input and its properties do not match any of the parameters that take pipeline input.
    Would anyone mind helping me out here?  If I need to create a file that has the source foldername as well as the destination path, I can do that, I just figured there has to be a way to specify a base directory and let powershell do its thing from there.

    try
    $SourcesFile = ".\sources.txt"
    $Root = "d:\temp\destination"
    foreach ($Source in (Get-Content -Path $SourcesFile)) {
    $Destination = Join-Path -Path $Root -ChildPath (Split-Path -Path $Source -Leaf)
    Copy-Item -Path $Source -Destination $Destination -Recurse -Force
    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) _________________________________________________________________________________
    Powershell: Learn it before it's an emergency http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx

  • Problem on appending the text file using FileConnection!!!

    it's in here...
    http://forum.java.sun.com/thread.jspa?threadID=718613&tstart=0
    my apology for double-cross posting..
    thanks much

    attachments
    Attachments:
    julian user not appended.JPG ‏260 KB
    julian user appended.JPG ‏257 KB
    galil mc USER rotation w File writing 5-16-14.vi ‏251 KB

  • Double quotes problem while uploading tablimeited text file to internal tab

    H all,
    I am uploading excel data using GUI_UPLOAD function module by converting excel to tab delimited text format.
    Problem is Material AB" is converted to "AB"  "           " material in tabdelimited text format.
    Can anybody give solution to problem?
    Is it possible to upload excel file directly using GUI_UPLOAD function module?
    I can not use 'ALSM_EXCEL_TO_INTERNAL_TABLE'  and  'TEXT_CONVERT_XLS_TO_SAP'
    as i want to upload upload fields of length 3000 cahrs and these function module uploads fields of only 256 chars.
    Thanks.

    Get a excel - 97-2003.Fil the data which you want to upload .(3 columns )
    A      I      B     I     C     I.
    save it
    Code :
    TABLES : thead.
    Structure to store the file name, as selected from the open dialog
    TYPES: BEGIN OF file ,
            filename TYPE file_table-filename,
           END OF  file.
    Output for excel
    TYPES : BEGIN OF test,
                   a(5),
                   b(5),
                   c(5),
            END OF test.
    Internal table of excel
    DATA : it_test TYPE TABLE OF test.
    DATA : it_filename TYPE TABLE OF  file,.  "to store file names.
                 ws_filename TYPE       file.
    SELECTION-SCREEN
    PARAMETER: p_file LIKE rlgrap-filename  LOWER CASE.
    At Selection Screen
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    Parameter to store the sy-subrc value from FM file_open_dialog
      DATA: rc TYPE i.
      CLEAR: it_filename,
             ws_filename,
             p_file .
    Get the file name and path from the presenatation server
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title            = 'Select Input File'
          default_filename        = '*.xls'
        CHANGING
          file_table              = it_filename
          rc                      = rc
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          not_supported_by_gui    = 4
          OTHERS                  = 5.
      IF sy-subrc = 0.
        LOOP AT it_filename INTO ws_filename.
          p_file = ws_filename.
          EXIT.
        ENDLOOP.
      ENDIF.
    DATA: l_file TYPE string.
      CLEAR it_test .
      l_file = p_file.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = l_file
          filetype                = 'ASC'
          has_field_separator     = 'X'
        TABLES
          data_tab                = it_test
        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 NE 0.
        WRITE: "Upload error".
        STOP.
      ENDIF.

  • Problem displaying CLOB in text file

    Hello All,
    I have a problem displaying the content from the database in notepad. When I click on a link on my jsf screen, I retrieve the data and display it in notepad.
    I have my text content stored in the database with CLOB datatype. When I look in the database the data looks in the following format:
    ---------STARTS FROM NEXT LINE-------------
    The firm, known for its keen oversight of products, has been the subject of complaints from firms who have had apps blocked from the store. Some developers have complained that the company's rules seem inconsistent.
    Some have found apps blocked after seemingly minor updates, or for having content deemed inappropriate by them. In light of this, and after careful consideration, I believe it is unnecessary to sign this measure at this time.
    Sincerely,
    ABC
    ----------ENDS IN THE PREVIOUS LINE------------
    Now when I display this content onto the notepad, all the spaces and new line characters are lost, and the entire display looks awkward. This is how it looks:
    The firm, known for its keen oversight of products, has been the subject of complaints from firms who have had apps blocked from the store. Some developers have complained that the company's rules seem inconsistent.[]Some have found apps blocked after seemingly minor updates, or for having content deemed inappropriate by them. In light of this, and after careful consideration, I believe it is unnecessary to sign this measure at this time.[]Sincerely,[]ABC
    All the new line characters are lost and it just puts some junk character in place of a new line.
    When I copy the same text onto textpad, everything is alright and it displays exactly the way it is present in the database. I am also open to display the content in html, but in HTML it doesn't even display me the junk character in place of new line. It is just one single string without any line separators.
    I am using the following code to put the content into the text.
    public String writeMessage(){
       OutputStream outStream = null;
       HttpServletResponse response = getServletResponseFromFacesContext();
       Reader data = null;
       Writer writer = null;
       try{
          response.reset();
          response.setContentType("text/plain; charset=UTF-8");
          response.setHeader("Content-Disposition","attachment; filename="+id+"_Message.txt");
          outStream = response.getOutputStream();
          QueryRemote remote = serviceLocator.getQueriessEJB();
          data = remote.retrieveGovernorsVetoMessage(billId);
          writer = new BufferedWriter(new OutputStreamWriter( outStream, "UTF-8" ) );
          int charsRead;
          char[] cbuf = new char[1024];
          while ((charsRead = data.read(cbuf)) != -1) {
             System.out.println(charsRead);
          writer.write(cbuf, 0, charsRead);
          writer.flush();
       }catch(Exception ex){
          ex.printStackTrace();
       }finally{
          //Close outStream, data, writer
          facesContext.responseComplete();
       return null;
    }Any help or hints on resolving this issue would be highly appreciated.
    Thanks.

    The data is imported from a third party application to my database. It doesn't display any newline characters when I view the data.
    But when I do a regular expression search on text pad, I could see that my clob contains \n as the new line character. Is there a way to replace \n with \n\r while writing the data.
    Thanks.

  • Problem in using a text area

    Hi All,
    I am having text area in my screen.
    I am using 
    CALL METHOD editor1->get_text_as_r3table
               IMPORTING
                   table = it_text
               EXCEPTIONS
                   OTHERS = 1.
    to get the text entered in the text area.
    The problem I am facing here is, When I am executing it for the first time the text is getting populated, but when I go back to my main screen and execute it once again I could able to retrieve the text. Can some suggest me a solution for this.
    Thanks,
    Arun

    Hi,
    I got the solution.

Maybe you are looking for

  • Source system BW100 does not exist

    Hi Guru's I'm trying to transport the datamart infopack from dev to QA and it's failed due to "Source system BD1_100 does not exist; InfoPackage ZPAK_DVDXOWDKOMSF5YW6F4EDXMXL1 deleted". I've tried to trnasport datamart as well but still failed what c

  • Solaris 10 for x88 install issue: cannot start X11 server

    AFter fixing my "can't set locale" problem I am moving onto the "Server for display :0 can't be started" issue. Checking /etc/dtc/Xerrors yields: 1) error (PID 380) : Server unexpectedly died 2) error (PID 380) : Server for display :0 can't be starte

  • Keepalive problem on CSS11506

    Greeting One of application which using my CSS has problem to work with my CSS11506 after the application upgrade. It does not regconize CSS' keepalive check and give error "broken pipe" on the backend server. (it treat the keepalive traffic as sessi

  • Downloading CS6 Master Suite when having a key but no media

    I purchased a license for CS6 master suite thorugh my school. The directions given by my school was to download the trial version and then activate it using the key. That was fine until last weekend when I had to reformat my laptop. I have no media f

  • The Color of Clipped Highlights

    After watching Jeff Sengstack's Color Correction series over on Lynda I dove into correcting for the first time with a home movie.  All is going well but when I'm using the RGB Color Corrector to brighten things up highlights from lit sources like li