Save string in text file

I have program to store Arabic string and save it in text file i use Eclpise there i did change the encoding to UTF-8 so i can read the string and print it fine but when i save it as a text file in c drive i get this ��������;����������������������;�������� insted of the arabic string.
this is a part of the code:
FileOutputStream fileStream;
try {
fileStream = new FileOutputStream ("c:/test/f1.txt");
PrintWriter pw=new PrintWriter(fileStream, true);
// s2=new String(s2.getBytes( "UTF-8"));
pw.println(s2);
} catch (FileNotFoundException e) {
e.printStackTrace();
}

Hi
Have a look at your OS settings and make shure that your OS regional setting allows support for Arabic.
If you are using Windows you can check the settings at
Start --> Settings --> Controll Pannel --> Regional and Language Options.
Regards
Vijendra

Similar Messages

  • Scheduling multiple tab BO XI3 report needs to save into multiple text file

    Hi,
    I have BO XI 3 Desktop Intelligence reports, those reports contains multiple tabs. Once after scheduling these reports the output needs to save as different text files (each tab as separate text file). Generally when select output as text file we will get the text file with the data of current tab, but in this scenario I want all the tabs data into different text files. I guess we can do this with macro. But I am not good in macro development, hope somebody can help me.
    Could you please help out for the same!
    Thanks,
    Rama

    Thanks Dan.. I made chenges in code as per your suggestion.. its working fine in DeskI -> local PC
    But this is not working in InfoView level... when i scheduled the same report its not saving into multiple text files... can you please have look...
    macro code as follows:-
    Public Sub SaveAsText()
    Dim StrTxtPath As String
    Dim BusDoc As busobj.Document
    Set BusDoc = ThisDocument
    Dim BusRep As Report
    Dim I As Integer
    On Error GoTo ErrHandler
    'StrTxtPath = "
    xxxx.xxx.xxx.com\common\Reporting\"
    StrTxtPath = "D:\Business Objects\Test_Macro\"
    For I = 1 To BusDoc.Reports.Count
    Set BusRep = BusDoc.Reports.Item(I)
    BusRep.ExportAsText (StrTxtPath & BusRep.Name)
    Next I
    ErrHandler:
    Exit Sub
    End Sub
    When i run this macro through DeskI.. its saving the report as multiple .txt files with respective number of tabs... but the same thing is not working when i tried in scheduling...
    Can you please suggest me what are the changes needs to be done...
    Thanks in Advance
    Thanks,
    Rama

  • Can I save and read text files on a server that I host?

    Hello everyone,
    I am a java hobbiest. I was wondering if I set up my own server, running out of my house, could I have my applets save to my computer and read from my computer without having to learn JDBC and a DATABASE language. In other words could i just have my applet save and read text files from and to my server?
    I'm trying to set up a sight for my 5th grade class where parents can log into. Thanks for your time.
    Oh yeah, which is easier, learning how to set up a server or learning JDBC and a DATABASE language?
    If you have any other good idease please tell me them
    Thank you, Bryan

    Short answer: This isn't gonna work
    Long answer: For this to work, the first thing you're going to need is a static IP address and a DNS name registered -actually you don't necessarily need #2 but you're probably gonna want it and it's by far the easier of the steps.
    As far as I know to get a fixed IP address you've either gotta be directly attached to a larger network (ie university network) or get a leased line from an ISP.
    Once you've got that done come back to us.

  • How to save string in a file with special-chars

    Hello,
    i´m usingthe MD5-llb to create a password.
    Then i  want to save this MD5-string to a file and later read it back abd compare.
    Works perfect with one proplem:
    Some word create a "\r" in the MD5-string and when i save this string to a file and read it back then its read back as a "\n" so that the compare is not working.
    My question is: How can i save a string exactly like it is to somewhere and read it back (also invisible chars)
    For example the word: heinz
    is in MD5: \r\FB^\07\A6\07T\C7\D9\C2\94\AB\C9\1DS\95 (string indicator as codes display)
    when i save the string to a file then i rerad back: \n\FB^\07\A6\07T\C7\D9\C2\94\AB\C9\1DS\95
    I used the "write text file" and "read text file"
    What do i have to use to save and read the same?
    Thx
    Solved!
    Go to Solution.

    I believe an MD5 hash is 16 bytes long. Use the binary read and write file I/O functions and specify the length of the data to be read or written.
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • How to save data from text file in databse for a transaction...

    Hi Guys,
    I have a text file which has some data related relevant to transaction VA01 separated by tabs.
    Now instead of going in the transaction in VA01 and thne feeding the data manually, I would like this data
    to get read automatically from the text file and get processed field by field for transaction VA01 and thne get saved.
    How do I achieve this ? Do I have to use SHDB or some other method ?a

    hi tushar,
    REPORT  ZCALL_TRANS_TAB1                      .
    TABLES: LFA1,LFBK,lfb1.
    *& internal table declaration
    data: BEGIN OF it_vendor occurs 0,
           LIFNR LIKE LFA1-LIFNR,
           bukrs like lfb1-bukrs,
           END OF it_vendor.
    DATA: BEGIN OF IT_BANK occurs 0,
          LIFNR LIKE LFA1-LIFNR,
          BANKS LIKE LFBK-BANKS,
          BANKL LIKE LFBK-BANKL,
          BANKN LIKE LFBK-BANKN,
          koinh like lfbk-koinh,
          END OF IT_BANK.
    data: it_bdcdata like bdcdata occurs 0 with header line.
    data: it_messages like bdcmsgcoll occurs 0 with header line.
    *selection screen.
    selection-screen: begin of block b1 with frame.
    parameters: p_file like rlgrap-filename default 'c:/vendor.txt'
    obligatory.
    parameters: p_file1 like rlgrap-filename default 'c:/xyz.txt'
    obligatory.
    selection-screen: end of block b1.
    *at selection screen.
    at selection-screen on value-request for p_file.
    perform f4_help using p_file.
    at selection-screen on value-request for p_file1.
    perform f4_help1 using p_file1.
    *start of selection
    start-of-selection.
    *******uploading file
    perform upload_file using p_file P_FILE1.
    ******open session.
    perform populate_data.
    *&      Form  f4_help
          text
         -->P_P_FILE  text
    form f4_help  using    p_p_file.
    data: l_file type ibipparms-path.
    call function 'F4_FILENAME'
    importing
       file_name           = l_file.
       p_file = l_file.
    endform.                    " f4_help
    *&      Form  POPULATE_DATA
          text
    -->  p1        text
    <--  p2        text
    form populate_data .
    DATA: L_STRING TYPE STRing.
    DATA: L_COUNTER(2) TYPE n.
    loop at it_vendor.
    perform bdc_dynpro      using 'SAPMF02K' '0106'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02K-D0130'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RF02K-LIFNR'
                                   it_vendor-lifnr.
    perform bdc_field       using 'RF02K-BUKRS'
                                  it_vendor-bukrs.
    perform bdc_field       using 'RF02K-D0130'
                                  'X'.
    perform bdc_dynpro      using 'SAPMF02K' '0130'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFBK-bankn(03)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=UPDA'.
    ******CALL TRANSACTION.
    call transaction 'FK02' using it_bdcdata mode 'A'
                            messages into it_messages.
    write:/ sy-subrc.
    perform format_messages.
    clear it_bdcdata.
    refresh it_bdcdata.
    endloop.
    endform.                    " POPULATE_DATA
    *&      Form  FORMAT_MESSAGES
          text
    -->  p1        text
    <--  p2        text
    form format_messages .
    data: l_msg(100).
    loop at it_messages.
    call function 'FORMAT_MESSAGE'
    exporting
       id              = it_messages-msgid
       lang            = sy-langu
       no              = it_messages-msgnr
       v1              = it_messages-msgv1
       v2              = it_messages-msgv2
       v3              = it_messages-msgv3
       v4              = it_messages-msgv4
    importing
       msg             = l_msg
    exceptions
       not_found       = 1
       others          = 2
    write:/ l_msg.
      endloop.
    endform.                    " FORMAT_MESSAGES
    *&      Form  bdc_dynpro
          text
         -->P_0173   text
         -->P_0174   text
    form bdc_dynpro  using    value(p_program)
                              value(p_screen).
    it_bdcdata-program = p_program.
    it_bdcdata-dynpro = p_screen.
    it_bdcdata-dynbegin = 'X'.
    append it_bdcdata.
    clear it_bdcdata.
    endform.                    " bdc_dynpro
    *&      Form  bdc_field
          text
         -->P_0178   text
         -->P_0179   text
    form bdc_field  using    value(p_fnam)
                             value(p_fval).
    it_bdcdata-fnam = p_fnam.
    it_bdcdata-fval = p_fval.
    append it_bdcdata.
    clear it_bdcdata.
    endform.                    " bdc_field
    *&      Form  upload_file
          text
         -->P_P_FILE  text
         -->P_P_FILE1  text
    form upload_file  using    p_p_file
                               p_p_file1.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
      CODEPAGE                      = ' '
       FILENAME                      = P_P_FILE
       FILETYPE                      = 'DAT'
      HEADLEN                       = ' '
      LINE_EXIT                     = ' '
      TRUNCLEN                      = ' '
      USER_FORM                     = ' '
      USER_PROG                     = ' '
      DAT_D_FORMAT                  = ' '
    IMPORTING
      FILELENGTH                    =
      TABLES
        data_tab                      = IT_VENDOR
    EXCEPTIONS
      CONVERSION_ERROR              = 1
      FILE_OPEN_ERROR               = 2
      FILE_READ_ERROR               = 3
      INVALID_TYPE                  = 4
      NO_BATCH                      = 5
      UNKNOWN_ERROR                 = 6
      INVALID_TABLE_WIDTH           = 7
      GUI_REFUSE_FILETRANSFER       = 8
      CUSTOMER_ERROR                = 9
      NO_AUTHORITY                  = 10
      OTHERS                        = 11
    IF sy-subrc <> 0.
    MESSAGE I000(ZZ) WITH 'UNABLE TO UPLOAD'.
    STOP.
    ENDIF.
    *******UPLOADING BANK DETAILS
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
      CODEPAGE                      = ' '
       FILENAME                      = P_P_FILE1
       FILETYPE                      = 'DAT'
      HEADLEN                       = ' '
      LINE_EXIT                     = ' '
      TRUNCLEN                      = ' '
      USER_FORM                     = ' '
      USER_PROG                     = ' '
      DAT_D_FORMAT                  = ' '
    IMPORTING
      FILELENGTH                    =
      TABLES
        data_tab                      = IT_BANK
    EXCEPTIONS
       CONVERSION_ERROR              = 1
       FILE_OPEN_ERROR               = 2
       FILE_READ_ERROR               = 3
       INVALID_TYPE                  = 4
       NO_BATCH                      = 5
       UNKNOWN_ERROR                 = 6
       INVALID_TABLE_WIDTH           = 7
       GUI_REFUSE_FILETRANSFER       = 8
       CUSTOMER_ERROR                = 9
       NO_AUTHORITY                  = 10
       OTHERS                        = 11
    IF sy-subrc <> 0.
    MESSAGE I000(ZZ) WITH 'UNABLE TO UPLOAD'.
    STOP.
    ENDIF.
    endform.                    " upload_file
    *&      Form  f4_help1
    form f4_help1  using    p_p_file1.
    data:l_file1 type ibipparms-path.
    CALL FUNCTION 'F4_FILENAME'
    IMPORTING
       FILE_NAME           = l_file1.
       p_file1 = l_file1.
    endform.                    " f4_help1

  • Updating equation in formula node from a string or text file

    Is it possible to have a calculation performed based on an equation stored in a string (read from a text file). I am guessing not because the equation would need be compiled but thought I would ask.

    Hi,
    it depends on how complex the equation is.
    Rather than using a formula node, you could use the eval formula node vi instead. (Functions->Analyze->Mathematics->Formula), but you may needs to re-organise the text formula a little.
    Assuming you're using not the base package, and atleast LabVIEW version 6.1 that shouldn't be a problem.
    Hope that helps.
    Sacha Emery
    National Instruments (UK)
    // it takes almost no time to rate an answer

  • Why this error in writing string to text file using utl_file?

    HI Friends,
    Iam trying to write procedure to add one line of text in text file using UTIL package. But getting error.
    create or replace procedure Add_To_File() is
    OutFile utl_file.file_type;
    l_err_code NUMBER(10);
    l_err_msg VARCHAR2(2000);
    vNewLine VARCHAR2(4000);
    vdir varchar2(200):='UTIL_DIR';
    begin
    OutFile:=utl_file.fopen(vdir,'out.txt','w','32000');
    vNewLine:='Loading is successfull';
    utl_file.put_line(OutFile,vNewLine);
    EXCEPTION
    WHEN OTHERS THEN
    l_err_code := SQLCODE;
    l_err_msg := SUBSTR(SQLERRM,1,128);
    Dbms_output.put_line(l_err_code || l_err_msg);
    end;
    when i execute above procedure iam getting this error.
    LINE/COL ERROR
    1/23 PLS-00103: Encountered the symbol ")" when expecting one of the
    following:
    <an identifier> <a double-quoted delimited-identifier>
    current delete exists prior
    Please suggest me where iam wrong.
    Thanks,
    Venkat Vadlamudi

    868591 wrote:
    HI Friends,
    Iam trying to write procedure to add one line of text in text file using UTIL package. But getting error.
    create or replace procedure Add_To_File() is
    OutFile utl_file.file_type;
    l_err_code NUMBER(10);
    l_err_msg VARCHAR2(2000);
    vNewLine VARCHAR2(4000);
    vdir varchar2(200):='UTIL_DIR';
    begin
    OutFile:=utl_file.fopen(vdir,'out.txt','w','32000');
    vNewLine:='Loading is successfull';
    utl_file.put_line(OutFile,vNewLine);
    EXCEPTION
    WHEN OTHERS THEN
    l_err_code := SQLCODE;
    l_err_msg := SUBSTR(SQLERRM,1,128);
    Dbms_output.put_line(l_err_code || l_err_msg);
    end;
    when i execute above procedure iam getting this error.
    LINE/COL ERROR
    1/23 PLS-00103: Encountered the symbol ")" when expecting one of the
    following:
    <an identifier> <a double-quoted delimited-identifier>
    current delete exists prior
    Please suggest me where iam wrong.
    Thanks,
    Venkat Vadlamudibelow works for me
      1  CREATE OR replace PROCEDURE Add_to_file
      2  IS
      3    outfile       utl_file.file_type;
      4    l_err_code NUMBER(10);
      5    l_err_msg  VARCHAR2(2000);
      6    vnewline   VARCHAR2(4000);
      7    vdir       VARCHAR2(200) := 'UTIL_DIR';
      8  BEGIN
      9    outfile := utl_file.Fopen(vdir, 'out.txt', 'w', '32000');
    10    vnewline := 'Loading is successfull';
    11    utl_file.Put_line(outfile, vnewline);
    12  EXCEPTION
    13    WHEN OTHERS THEN
    14            l_err_code := SQLCODE;
    15            l_err_msg := Substr(sqlerrm, 1, 128);
    16            dbms_output.Put_line(l_err_code
    17                           || l_err_msg);
    18* END;
    SQL> /
    Procedure created.

  • Replace a string within text file to another string

    hi everybody
    i wich to replace some word writed in text file to another word,,,,for example i want to replace all word when the word is "SOLARIS" to "solaris" .
    anyone have an idea to resolve this prob via command or script,plz respond me.
    thanks

    To elaborate on alan.pae's response:
    sed 's/SOLARIS/solaris/g' oldfilename > newfilename
    -systemstate

  • How Do I Save an ASCII Text File?

    In the Windoze world, Notepad is a simple editor that saves text strictly in ASCII format. Clean, not embellishments or tags. Sometimes it needs to be that way.
    What do I use to save ASCII text on a Mac? Somebody at the Apple store told me the answer is TextEdit, but when I went to save a file just now my choices were rich text (.rtf), HTML, Word format, or XML. No ASCII in the bunch.
    So, is there a program on here that does what Notepad does? Is there one out there somewhere...??
    --PS

    I forgot to mention, that this can also be set in the Preferences of Textedit to be the default setting:
    use plain text; add .txt extension when saving.
    I think that's all I needed to hear -- I've looked at the preferences for TextEdit and set them the way I think I want them.
    Thanks,
    --PS

  • Searching for string in text files on XP

    Hi,
    At the moment I'm working on a Struts program. The output I get is:
    The requested resource (Invalid path /displayAddProductForum was requested) is not available.Somewhere in my files, I have a line containing /displayAddProductForum that should be displayAddProductForm. As I'm using XP as my development platform, I use the 'Windows Explorer' search facility. And I have noticed this search facility does not look in .java, .jsp and any other file with a non-Microsoft file-extension. So, how do you search for a string in a source file on XP?
    Abel

    sabre150 wrote:
    kajbj wrote:
    sabre150 wrote:
    Abel wrote:
    , I use the 'Windows Explorer' search facility. And I have noticed this search facility does not look in .java, .jsp and any other file with a non-Microsoft file-extension. So, how do you search for a string in a source file on XP? Err.. On my XP it does search though java/jsp files if I tell it to!You mean by modifying the registry?No! Using the right mouse click on a directory to get a context menu -> Search -> (All or part of filename : .java ) and (A word or phrase in the file : blah blah blah) -> Search
    Edit : Errr.. maybe I'm talking rubbish because I have just tested this and it only finds 5 java files of mine that contain the word 'class'! I'm sure it used to work because in my 'Windows' days I frequently used it.
    Edited by: sabre150 on Dec 20, 2007 12:44 PMSounds a bit odd. Search in windows should only search in registered file types and neither jsp nor java are registered types. It's however possible to modify the registry and add extensions (but it's not possible to say search within all types of files, and that sucks)

  • Save Digital Data to a Text File

    I have digital data collected from two ports simultaneously as N number of samples in waveform that I do calculations on to get a result. I would like to save the raw data in a text file so that it can be easily viewed in an external program, like Excel.  This file would be used as verification of the result calculated in my program. I would think this would be a simple thing to do in labview but as yet have not figured it out. I’ve tried to change the digital to analog and then save as a text file but the data no longer gives the same results when recalculated in an external program. Thanks for any input on this subject.
    Tessa

    I am using 8.20. 
    Thanks, Tessa
    Attachments:
    Cannon Screenshot2.JPG ‏154 KB

  • Write voltage to text file

    I am reading voltages from a few instruments that are currently being displayed in numeric indicators.  How would I write the voltages read from each channel to separate text or spreadsheet files?

    Hello Aye,
    to save to a spreadsheet file just bundle all info into a 1D array (if you read a point voltage), of into a 2D array (if you read several voltages over time).
    if you want to make nice report on every channel, here a solution to save on a text file. every voltage reed gets an index and its value. the finished string goes to a "save to txt file"
    Message Edited by Gabi1 on 05-06-2007 02:11 PM
    Message Edited by Gabi1 on 05-06-2007 02:12 PM
    ... And here's where I keep assorted lengths of wires...
    Attachments:
    save to spreadsheat and to text.PNG ‏7 KB

  • Optimize way to manipulate Big text file ?

    Hi all,
    Here I start my story .. 
    Long long time ago, Mr.A has a big text file (let say 120 columns X 840k rows) , around 100MB. He wanted to swap the text column according to the input number, let say,
    if input are 1,2,3,10,20,30, 
    output = a file with 6 columns, taken from column 1,2,3,10,20,30 of the big text file.
    Then he found that the VI taking too long time to do the extracting. (the subVI consists of the normal array function, let say index array, insert array to create a new array, then save to a text file).
    Hence, he chops the big text file to smaller text files (65k rows each text file), and he found that it's still taking a lot of time although the extracting time has improved a lot. Then he chops the files to 1024 rows each text file. And he end up with taking a few minutes too, to get the output file produced. (since smaller files = more files = more time consumed to open and close the file).
    So, here I m asking help from expertss here.. Any idea to optimizes the way shown above ? Any ideal number of rows (120columns) to shorten the extracting time for the situation above ? 
    please advise. Thank you very much..

    Hi,
    Thanks for you guys' replies ..
    What is the format of the text file?
    .txt 
    Fixed column widths, or delimited?
    ya the number of columns is fixed for whole file. Delimiter = <space>
    How are you reading the file ?
    by using "read from spreadsheet file" ..
    Here I explain more on my purpose.
    Another purpose I chop the big file to 65k rows perfile is because the VI after this section (spreadsheet string to digital) cannot process huge data at once. So, the 65k of rows is the maximum row allowed for my case.
    Then I chop it to smaller to observe if it will improve the performance....My VI is somesort like
    spreadsheet string to array => index the column => append all the columns => array to spreadsheet string
    I believe this is no good for big file ..
    Here I attached a text file sample .. Thanks for the advices. 
    Attachments:
    wf241basicreadwrite1to1patternstdwavesq0.txt ‏211 KB

  • Problem with alv output export to text file

    hi experts,
    when iam exporting alv output to text file,
    some data is missing in text file.say for example sold-to-party value is 1155027 in alv out put,but in text file it is showeing only 115502 ,
    the last digit is missing,
    can anyone help urgent!!!!!

    and when you export it to excel?
    from here you could save it as text file too...
    A.

  • Can I save an open PDF file as a .jpg using Acrobat Reader?

    Is there some kind of ad-on or other (third party?) program which would allow Acrobat reader to save or convert a PDF to a JPG?  I have the full version, along with Adobe Creative Suite, so I know I can do it with those programs.  This is for a friend with whom I share files and he only had the Acrobat Reader.
    Thanks

    No, Adobe Reader can only save as a text file, or using ExportPDF as Word or Excel documents.
    However, use Google to find many free PDF conversion tools on the Internet.

Maybe you are looking for

  • PDF attachments are changed when emailed

    I have a user that whenever she creates or prints a PDF (Adobe 8 Professional) and then tries to email it within Adobe (going to file -> attach to an email), it converts to either a winmail.dat, .eml or a .mht file when the person receives it. It onl

  • Exp/imp problem

    Hi, I am trying to export on my solaris machine. But the problem is, there is no space on the machine (as much big as the db). So can i export. Please advice Regards

  • Import Folder Names

    How can I import folders from iPhoto and keep the folder names?

  • Total Number of Votes in User's Statistics

    Could the AUR have a statistic that says how many votes for each package in total a user has? Last edited by matthewbauer (2009-07-25 23:39:38)

  • Duration of CommPortIdentifier.getPortIdentifiers() ?

    Hi all, I have a questino about the duration of CommPortIdentifier.getPortIdentifiers() In my code I use CommPortIdentifier.getPortIdentifiers() and place it into an Enumeration portList, the problem is that it takes about 120 seconds to execute port