Opening TXT output file in notepad alignment is distorted

Hi,
I have written a problem that reads data from the database and writes it to a TXT file. While opening this in tools like Ultraedit or Textpad, the alignment is perfect.
When the output is open in notepad, the alignment is distorted.
Any idea why this might be so ?
Thanks,
Sajiv

No, I am using spaces.
I retrieve the data from the table, each row is fixed in length. Every line is of course separated with \n. Here is a snapshot of the program. See the method fillspaces below.
public int writeAll(java.sql.ResultSet rs, boolean includeColumnNames)
throws SQLException, IOException {
ResultSetMetaData metadata = rs.getMetaData();
if (includeColumnNames) {
     writeColumnNames(metadata);
int columnCount = metadata.getColumnCount();
while (rs.next())
     rowCount++;
     String[] nextLine = new String[columnCount];
     for (int i = 0; i < columnCount; i++) {
          nextLine[i] = getColumnValue(rs, metadata.getColumnType(i + 1), i + 1);
          switch(i){
          case 0:
               nextLine=fillSpaces(nextLine[i],40);//external_id
               break;
          case 1:
               nextLine[i]=fillSpaces(nextLine[i],150);//name
               break;
public String fillSpaces(String value, int len)
     StringBuffer sb=new StringBuffer(value);
sb.setLength(len);
String str1=sb.toString().replace('\u0000', ' ');
return str1;

Similar Messages

  • Dynamic file name in case of .txt output files

    Hi all,
    I have a query related to dynamic file name scenario.
    In case of IDOC-XI-FILE sceanrio,
    <b>Is it possible to generate .txt file name based on Plant number like</b>
    <b>%<Plantname>%_%<BusinessDay>_filename.txt</b>
    <b>Note:I have implemneted this for .xml output files but I am not able to implement it for .txt output files .</b>
    PLEASE HELP ME .
    Regards
    Prabhat

    Hi Prabhat,
    I think, the normal Dynamic File Name generation should work fine in your case also. Even if you perform Content Conversion, you can use Variable Name Substiution to create your Destination file name as, the name of the file is determined first and only then is the content converison perfromed.
    for info on content conversion, I would suggest that you go through this thread and check my reply,
    Re: Dynamic  File Name for Receiver File Adapter
    Regards,
    Bhavesh

  • [SQLSTATE 22001] (Error 8152)Unable to open Step output file.

    Hi,
    I have configured the backups from our SQL Server instance to tape directly with out storing in the local drive, so that the disk space allocated for storing the backups in the local drive is saved. 
    but i end up with the below error.
    Executed as user: CORP\devsqlservice. select       DATABASE_NAME   = db_name(sd.database_id)      from       sys.databases sd      where         -- ONLINE    
      sd.state = 0        and sd.is_read_only = 0      group by sd.database_id      order by 1 [SQLSTATE 01000] (Message 0)  String or binary data would be truncated. [SQLSTATE 22001] (Error 8152)Unable
    to open Step output file.  The step failed.
    I am clueless , why i face this error, Do any one of you face such problems in backup (scheduled backups) job. 
    hemadri

    Hi Hemadribabu,
    >>”string or binary data would be truncated”
    As my research, the error above could occur in the case of passing string or binary data, whose length is larger than received object. So I recommend you to run the Transact-SQL script in SQL Server query window to check if this kind of issue exists, or
    you can post your entire script for further analysis.
    >> “unable to open step output file”
    In addition, as for the error above, this issue can be caused by two reasons below.
    1. The path of the output file is invalid. To fix the issue, please follow the steps below.
        a. Double click on the SQL Agent job.
        b. Switch to Steps tab, and click Edit.
        c. Click Advanced option.
        d. Change the path under Output file or delete the path. For a UNC path, you can 
    map a network drive and use the network drive instead.
    2. Your account doesn’t have access to the folder. Transact-SQL job step runs as the owner of the job step, or as the SQL Server Agent service account. So please check the type of the job step and the account which your job step runs as, and make sure that
    it has access to the folder. For more information about the process, please review the similar thread:
    https://social.msdn.microsoft.com/forums/sqlserver/en-US/7610b484-98b7-42dc-816f-dbc884e84c6d/backup-database-permission-problem   
    Regards,
    Michelle Li

  • How to open a text-file with notepad from labview-vi?

    Hello,
    how can i execute a program from a vi?
    I want to open a textfile with Windows7-Notepad after selelecting it from a file-path-control and pressing an open-button.
    Thx for help
    Solved!
    Go to Solution.

    Use the command line.  Something like cmd /c notepad c:\temp\blah.txt should work.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Problem with opening various text files in notepad through java

    Hi friends,
    I need to open any .txt file in notepad by running the code in Java.I could open the notepad through java but not a perticular file.I dont even want to hard code my program that only one perticular file will open through it.I want it generalised...if anyone could help me,it would be really nice...
    thanks
    Vishal.

    If your program opens notepad I'll delete it because I set UltraEdit as my default editor. So if you already must use system-specific code, how about grabbing a Windows manual to find out how to use the editor registered for these files? (Hint "start").

  • IDOC to XML : error in opening the output file in iexplorer

    Hi Frnds,
    I have a scenario IDoc to xml where in Im getting some non ascii values in the idoc for which I used ISO-8859-1 encoding technique but still the conversion is not done. Iam unable to opend the output file in internet explorer giving the follwoing error as :
    An invalid character was found in text content. Error processing resource
    Please help me how to overcome this issue.
    Thanks in advance,

    Hi,
    As i posted previously in xi UTF-8 is the default encoding if message protocal is FILE.
    And UTF-8 encoding support unicodes..
    Can reconfigure your receiver file adapter with file type as Binary and check once again.
    go through http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/frameset.htm  
    refer  File Type
    now i check with a japanese double byte character and i can open in iexplorer.
    regards,
    pradeep A.

  • Opening Multiple Reader Files Stacked and Aligned

    I know it's a strange request but...
    A coworker of mine is wanting all of the Reader files that she opens to have each Reader window aligned and stacked on each other instead of them cascading or randomly arranged. These are all the same size documents and the layout is the same but just different content for each.
    I have tried changing the preferences under Open Settings in "Documents" to "check Restore last view settings when reopening documents". But it isn't working.
    Anyone else require this or know how to make this happen?
    Jim

    I don't believe you have any control over this.

  • Vivado opens copy of file in Notepad++

    Hi. I use Notepad++ as a text editor. When I press on error link in Vivado Message window the wrong files opens in Notepad++ and cursor place on required line.
    But if I press the next time on the link opens previous file reopen as new and I get two same windows. In Ise editor was solution: {c:\Program Files (x86)\Notepad++\notepad++.exe} -n$2 $1.
    What should to do to doesn't open new screen and cursor changes a line in opened document? Thanks (Sorry for my english)

    do you have solution ?

  • Opening a text file in notepad using swing

    Hi,
    I am trying to getting all files and directoriess from my Home Drive to JTreeModel, and i also want whenever i click into text file the contents should be open in notepad, but i am not able to add this feature, can any one help?
    Suresh

    Suresh_Dewangan_1981 wrote:
    No, I am using java 1.5 only, please help me accordingly.
    import java.io.IOException;
    class StartTxt {
        public static void main(String args[])
            throws IOException
            String fileName = "c:\\temp\\test2.txt";
            String[] commands = {"cmd", "/c", "start", "\"DummyTitle\"",fileName};
            Runtime.getRuntime().exec(commands);
    }Bye
    RG.

  • Error message when publishing and problems opening output file

    I have 5 projects linked together. When I publish one, I get a message that the files listed below are linked to the open project, and one or more of these projects may require exporting. I have tried to open these files and choose File | Export | Project to | but the options in the list (Flash 8 and Flash CS3) are both grayed out--on every one of these files. I'm publishing to Flash 9.
    I didn't think much about this message until a few reviewers said they can't open the project, or when they do, they don't see my playbar on the skin.
    One more thing--when an IT person was trying to help one reviewer open the output file, the IT person said "Oh, there's a problem with the code in line 25." I guess that's the html code? I'm not a programmer, but I can look at html code. What should I be seeing there in line 25?
    Is their problem opening the output file(s) related to my message about possibly needing to export files? Why might they be having problems getting the output file to open?
    Thanks for any insights you can provide!
    SAM

    Hi Sam
    It depends on a number of things. Are you certain you uploaded all the files involved? If not, there will be problems.
    The message about the linked files is quite simply advising you that you have links from that particular movie that will expect to find the files being linked to.
    If a person isn't seeing playback controls and you have included them, it's likely you haven't provided the correct link for them to open and play the file. Typically you provide a link to the HTML page Captivate creates. As long as all the output files are in the same place on the server, you should be good to go.
    Cheers... Rick
    Click here for Adobe Authorized Captivate and RoboHelp HTML Training
    Click here for the SorcerStone Blog
    Click here for RoboHelp and Captivate eBooks

  • Opening a file within Notepad

    Hi,
    I am trying to open a text file within Notepad from within my java code. The aim is to provide a user with the ability to view a log file (generated by my application) simply by pressing a button on the user interface.
    How can I do this?
    I know how to open Notepad:
    try {
    String command = "C:\\Windows\\Notepad.exe";
    Process child = Runtime.getRuntime().exec(command);
    } catch (IOException y) {
    But I don't know how to open the file within it!
    Thanks in advance,
    John

    Why not justString command = "C:\\Windows\\Notepad.exe " + theFileName;?

  • Csv output file help

    hi
    I wrote a code as
    buf :=
    ' " ' || AREC.l
    ||lim||AREC.f
    ||lim||AREC.m
    ||lim||' " '||AREC.d|| ' " '
    ||lim||' " '|| AREC.c||',"' ||' " '
    I wrote this code for getting the output as
    l f m d c
    a b c 000234 000234 in excel file
    but I am getting the output as
    l f m d c
    a b c 000234"" 000234""
    I declared lim:=' "," '
    please help me in this
    thanks

    try to post the complete code so we can see where might have the lim change it's value. or try to open your created file in notepad to see the format.
    i tried to simulate and here is what most likely you will get when you try to open the file in notepad:
    SQL> select ' " ' || 'l' || ' "," ' || 'f' || ' "," ' || 'm' || ' "," ' || ' " ' ||
      2         'd' || ' " ' || ' "," ' || ' c ' || ' "," ' spool_text
      3    from dual;
    SPOOL_TEXT
    " l "," f "," m ","  " d "  ","  c  ","
    SQL>

  • Why the output file invisible from JCreator??

    i developed a program with JCreator. with the program, i intend to write something to an output file with the codes like:
    FileOutputStream fos = new FileOutputStream("output.txt");
    DataOutputStream dos = new DataOutputStream(fos);
    for(int i=0; i<10; i++){       
    String s = i+" ";           dos.writeChars(s);
    fos.close(); dos.close();
    how come when i open the output file from JCreator, i can not see anything there? yet, when i directly open the file "output.txt" from the directory storing the program source codes in the operating system, the output string "0 1 2... 9" is visible.
    quite confused! could you please illumine?

    I am not sure of my facts but I think the problem is as follows. DataOutputStream writes bytes of primitive information. You can use the method .writeUTF() which is an ASCII-compatible encoding, instead of .write().
    However textual output should be done with PrintWriter (or PrintStream in Java 1.0). JCreator is expecting ASCII or text to read.

  • Request Phase as Completed and Date Completed Empty (no output file generated yet)?

    Hi,
    When I run the request, the phase = "completed", but when you open the details form, you notice that 'date completed' = empty, and the 'completion text' keeps changing every time you open the details screen.Also, when you try to open the output, it is not there (yet).And when you look into the logfile you only see the first couple of lines (with some info about the select statement in), but none of the logfile messages yet.
    This situation stays unchanged for several minutes (up to 15 min). Only when the 'date complete' is filled in you can open the output file and see the complete logfile.
    To me this behavior is very unusual, never had this before in Apps, even with long-running requests.
    This will cause confusion for users when they run these programs.
    Any help or any guidance would be appreciated.
    Thanks in advance.

    Yes, if the data is not generated , in the report,
    when you try to open, it says , no pages to display.
    i have a suggestion, if it is custom RTF, open and handle the no data case and display
    something in the report saying. some message like "No Information for this report".
    in this case, the PDF generated will have atleast a page, saying something, and the report will get into printer and print properly.

  • How to view the log/output output files in browser through email notification hyperlinks

    I am working on an extension in Fusion Applications. The requirement is to send a notification with details of a concurrent program. The notification will have hyperlinks of "out" and "log" files. When the user clicks on the "out" hyperlink, it should open the Output file(that resides in the unix box) of the corresponding concurrent program in the browser. We know that in E-business suite R12 functionality, records should be populated in FND_FILE_TEMP table to view any files from unix box in browser.
    Can you please let me know the approach to be taken in Fusion Applications?

    The format of the start and end timestamp ranges are "MM/dd/yy HH:mm:ss" for example 12/01/09 12:00:00. Give this a try.
    Thanks

Maybe you are looking for

  • How to view images from PC on MAC

    Have iMAC 10.6.8. Using iPhoto '09. Have lots of pictures saved on CD downloaded from a PC. Problems viewing them on MAC. First, what is an easy way to view them on MAC without transferring them, and secondly, what is the best way to transfer them to

  • Run time Error : UNCAUGHT_EXCEPTION

    Hi Team Pls reply to resolve the below error When we are uploaded TB through flexible upload  and then Test run for Data Collection for that Cons unit, we got the below Run time error: Runtime Errors         UNCAUGHT_EXCEPTION                        

  • Can someone tell me if this is a good product for the mini?

    Go to this website (you have to copy/paste into your web browser): http://cgi.ebay.com/Apple-MAC-mini-80GB-HD-Backup-Firewire-USB2-0-HUB_W0QQitemZ5 808009357QQcategoryZ80044QQtcZphotoQQcmdZViewItem it's an external 80 GB hard drive for the mini, and

  • Java Importer: import of java.lang.Boolean does not compile?

    I have created a webservicestub for the Reports webservice with JDeveloper. Now I want to use it in Forms. All methods work correctly, except the runJob method, which uses a boolean argument. I think I need to import java.lang.Boolean for it, but the

  • Users upload in SRM system

    Hi friends I wanted to know the order of the fields in which they have to be arranged in a file to upload the users in the SRM system, using users_gen. I want the header like which field belong to what ? Can anyone guide me on this. Regards Srujan