Copy the contents of Jtabl with line breaks to Excel

Hi every one,
In my stand alone application,I am copying the contents of Jtable i.e contents having the line breaks(\n).
While copying and pasting the contents to Jtable,instead of linebreaks, a square symbol is appearing in the excel along with the line break.line break functionality is happening,but the additional symbol(empty square box) is appearing.
here is my code:
S = (String) "\""+mProcessQuestionTestItemTable.getValueAt(rowsselected, colsselected[j])+"\""; S=S.replace("\r\n", "\n").replace("\n", "\r\n");
stringbuffered.append(S);can anyone help me in this?
thank you!!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Hi,
I want to copy the contents of Jtable(contents having Line breaks(\n)) and pasting to Excel.
While pasting the contents to Excel, a box is appearing in the excel.
To remove the empty square box, i tried the sample code:
originalstr =(String)"\""+ mProcessQuestionTestItemTable.getValueAt(rowsselected, colsselected[j])+"\"";
originalstr=originalstr.replace("\r\n", "\n").replace("\n", "\r\n");
strngBuffere.append(S);
There will be no box,If i copy the contents of Jtable and pasting in notepad.
the box is appearing in Excel only.
can you suggest something to solve this..
Thank you.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Applescript batch convert DOC to TXT with line breaks

    Hey guys, I recently got stuck at work having to convert over 1,000 DOC files to TXT files with line breaks.
    I've found online several different Applescripts that work great at converting DOC files to TXT files but I can't find one that will do the TXT files with line breaks.
    If anyone has a script that can do this I would be crazy grateful.
    Converting these one by one with Word is taking forever to do.
    Thanks for any help you can give me.

    Excuse me for a moment for speaking harshly to you.  You are causing yourself utterly unnecessary headaches by not being clear with us and not stopping to think, and it's high time you learned that that is an incorrect way to approach anything on a computer.  Consider:
    you don't know what you're doing (in the sense that you don't know what 'text with line breaks' means)
    you don't know (or at least haven't explained) why this needs to be done
    (therefore) you don't know if this needs to be done at all
    (and yet) you are doing it anyway, in a mindlessly repetitive fashion, driving yourself batty and irritating me
    At least for the time being, humans are the ones who think and computers the ones who grunt away mindlessly; try to reverse those roles and everything gets done badly and slowly. Stop, look, think, plan ahead - that's what your brain is good at if you give it a chance.
    Now, as far as I can tell from poking around the web, 'text only with line breaks' means that the document  is saved as a plain-text file, but with a carriage return linefeed combination (CR/LF) as a paragraph delimiter (this is a Windows format - unix uses a single linefeed, Macs might use a single carriage return or a single linefeed). I don't know why anyone would want that format - most software will convert that seamlessly (or at least can be told to convert that).  Are you trying to feed this into some dinosaur of a database?  At any rate, if that's what you want, this script should do it. caution, this script overwrites the original files; I suggest you make a copy of one or two files in a separate folder, and run the script on them first to check that the output works for whatever reason you're doing this:
    set baseFolder to choose folder with prompt "Choose a folder of files to process"
    tell application "Finder"
              set fileList to (every file of baseFolder whose name extension is "txt") as alias list
    end tell
    repeat with thisFile in fileList
              set itsText to read thisFile
              if (offset of (return & linefeed) in itsText) = 0 then
      -- file is not already formatted with CR/LF, so convert
                        set itsChunks to tid(itsText, {return, linefeed})
                        set itsNewText to tid(itsChunks, return & linefeed)
                        set fp to open for access thisFile with write permission
                        set eof of fp to 0
      write itsNewText to fp as text
      close access fp
              end if
    end repeat
    on tid(input, delim)
      -- handler for text items conversions
              set {oldTID, my text item delimiters} to {my text item delimiters, delim}
              if class of input is list then
                        set output to input as text
              else
                        set output to text items of input
              end if
              set my text item delimiters to oldTID
              return output
    end tid

  • Re-post Replacing Hyphen with Line break

    Can someone please respond to the post: Replacing hyphen with line break
    Thanks.

    Please learn proper forum etiquette. Posts like this are (a) unnecessary and (b) actually quite annoying. At the very least, bump the original posting (but not, like, 30 minutes later because noone answered).

  • Unable to copy the Price Modifiers associated with a Sales Order Line

    Dear All,
    I am copying Sales Order Line using the process_order API. I was not able to copy the Price Modifiers associated with the Lines. How can I accomplish this..?
    Is there any API available for copying the Price Modifier info associated with the Sales Order Line..?
    Environment is 11i and OS is SUN Solaris
    Please update...
    Many thanks in advance..

    Hello All,
    Please let me know is this possible to have the list of Invoices for an associated Sales Order.
    Thanks,
    Abdul

  • I want to copy the contents of Ipod 32 MC544LL down to my laptop

    When I first got my Ipod I had a pc....which I burned several CD to the Itunes new libraries...then got a laptop and my troubles began,
    I would like to copy the contents of my ipod down to my pc and then move that copy over to my itunes folders so they both will be in syc so when I hook
    my ipod into the laptop the burned CDs will not be over written and i won.t lose them....I can not believe that I have to use freeware or purchase software to
    do this.....freeware always messes up my laptop so can you teach me how to do this....a while back a support person showed me something along the lines
    but I can not remember how I got the Ipod to show me the song while hook into the laptop...oh and please tell me how to answer the questions that the laptop is
    going to ask when plugging in the ipod to the laptop thanks!

    See this support article:
    http://support.apple.com/kb/HT1848
    You can also download at least some of your content (audiobooks being a notable exception) again from the iTunes Store:
    http://support.apple.com/kb/ht2519
    For additional instructions, particularly for content not purchased from the iTunes Store, check out this user tip from TuringTest:
    https://discussions.apple.com/docs/DOC-3991
    and this page on "How-to Geek":
    http://www.howtogeek.com/104298/sync-your-ios-device-with-a-new-computer-without -losing-data/
    Regards.

  • How to avoid starting a page with line breaks?

    Hello. I've just started to refine my Master's thesis and some of the topics moved up and down as I edited their contents. The problem is that in some cases the topic breaks right after the title, and the rest of the contents just move away to another page. Is there any way to avoid starting a page with line breaks or broken topics?

    At the end of your title, you didn't inserted a line break but a paragraph break (carriage return).
    Acivate the mode "Show hidden characters"
    Select the carriage return (paragraph break)
    Delete it
    Press Shift + return to insert a true line break.
    It may be useful to apply that several times if you inserted several carriage returns between the title and the first filled line.
    Yvan KOENIG (VALLAURIS, France) 15 mai 2011 19:40:14

  • Can I copy the contents of a dvd to the hard drive?

    How can I copy the contents of my dvd to the hard drive? It is from a home movie that was transferred onto a DVD. I would like to send it via e-mail. is this possible?
    thanks

    You need to convert it first to a smaller file.  You can't typically send several gigabytes of video via email.  You could copy the contents of the DVD to your mobile me account by making a Disk Image of the DVD using the Disk Utility.  A typical DVD is 4.7 gigabytes, so the coping will take over night.  If you just want people to view the DVD movie, you might want to rip it from the DVD and put it on Youtube as a private video.  I would recommend doing this with DVDxDV.  It can break up a long video into multiple parts and upload it to Youtube. 

  • Using PowerShell to Copy the content of a Word Document and Paste that content into a New Message in Outlook

    So, I'm a little new to PowerShell and I came across a PowerShell which allow me to copy the content od a spreadsheet, into the new message in Outlook 2007.  I have search and search on a way to do the same with a Word Document.  I would like to
    create a PowerShell Script that copies the content of a Word Document and paste that content in an email message.
    I am basing my script on this
    #Create and get my Word Obj
    $w1 = New-Object  -comobject Word.Application
    $w1.Visible = $True
    $UserWord = $w1.Workbooks.Open("C:\Users\hhhh\Documents\Powershell\test.docx")
    #create outlook Object
    $Outlook = New-Object  -comObject  Outlook.Application 
    $Mail = $Outlook.CreateItem(0)
    $Mail.SentOnBehalfOfName = "[email protected]"
    $Mail.Recipients.Add("[email protected]")
    #Add the text part I want to display first
    $Mail.Subject = "Test email"
    $Mail.Body = "My Comment on the Excel Spreadsheet"
    #Then Copy the Word using parameters to format it
    $Mail.Getinspector.WordEditor.Range().PasteExcelTable($true,$false,$false)
    #Then it becomes possible to insert text before
    $wdDoc = $Mail.Getinspector.WordEditor
    $wdRange = $wdDoc.Range()
    $Mail.Display()
    Any Help would be great!

    My requirements are the Word documents are a template of sorts.  The document will be changes prior to its email with some changes.  The other twist is that the customer might more that one recipients, and each recipient will have to have a separate
    email, with the same content of the word document. 
    For example: Say I'm doing maintenance. The Word doc might descript that maintenance, in a set format. Once save the script is run to generate 3 to 10 email with separate recipients with the body of the email containing what was in the Word document.

  • How to get(copy) the contents i.e the cell of an excel sheet to other excel

    How to get(copy) the contents i.e the cells of an excel sheet to another excel sheet.
    I can read the contents i.e the text in the cells and able to display it in the Java console
    i want these contents to be copied to another excel sheet with the cells data.
    I am using Java Swing for the UI, POI framework for the excel work.
    Please anyone suggest some code to this requirement.

    [spreadsheets with poi|http://poi.apache.org/spreadsheet/converting.html] Hi
    on the poi apache site there's a number of good examples...
    I started with poi only a week ago, but just from reading these examples
    (especially SS Usermodel code) i managed all i needed to know (so far).
    kind regards
    BB
    Edited by: BugBunny on Feb 22, 2010 4:36 AM

  • Saving the content of JTable into a ascii file?

    Suppose I have a JTable with certain cols and rows, is there an easy way to retrieve the table contents and save them into a ascii file on disk?
    Thanks for your help.
    helen

    If colCount or rowCount is quite big, the "for loop" will spend some time to get the table content. Is there other way (not doing "for loops") to get the contents of JTable?
    Thanks,
    Helen
    TableModel model = mytable.getModel()
    PrintWriter writer = new
    PrintWriter(BufferedWriter(new
    FileWriter("test.dat")));
    int colCount = col < model.getColumnCount();
    int rowCount = model.getRowCount();
    for (int row=0; row < rowCount; row++)
    for (int col=0; col < colCount; col++)
    Object value = model.getValueAt(row, col);
    if (value != null)
    ll) writer.print(value.toString());
    if (col < rowCount - 1) writer.print("\t");
    writer.println();
    writer.close();What's so difficult with this, that the question pops
    up every week ?
    Thomas

  • Copy the content of a sheet in excel and paste it in a new sheet.

    How can I copy the content of the first sheet in excel and paste it in a newly created sheet. Both sheets have specific names (not sheet1 and sheet2).
    Attachments:
    Repeat_Report_monday.vi ‏85 KB

    To copy the entire contents to the new sheet:
    Select the Target sheet by name using property Sheets->Item("Target")
    Convert target to WorkSheet
    Wire target's WorkSheet->Range("A1") to specify destination
    Use Sheets->Item("Source") to select the source sheet
    Convert source to WorkSheet
    Wire source to property WorkSheet->UsedRange
    Wire to method Range->Copy, wire target range to Desination input
    Note that no Paste function is required.
    Michael Munroe, ABCDEF
    Certified LabVIEW Developer, MCP
    Find and fix bad VI Properties with Property Inspector
    Attachments:
    Repeat_Report_monday_mod.vi ‏87 KB

  • Applescript batch convert .RTF to .TXT with line breaks

    Hey guys, looking for help with an Applescript that can change a .RTF to a .TXT with line breaks.
    I have an Applescript that will go from a .DOC to a plain .TXT but haven't found anything to get from the .RTF to a .TXT wth line breaks.
    I'm doing this for Avid's Script Sync.
    Thanks for the help.

    Ok, you obviously mean something specific by "line breaks" that you're not being clear about.  are you looking for a specific kind of line ending: Mac style carriage return (CR) ending? Windows style carriage return line feed (CR/LF) endings, unix style line feed (LF) endings?  textutil provides LF by default (it's a unix utility after all); if you need a different line ending you'll need to pipe it through tr or modify it via applescript after you've done the conversion

  • I have two computers and one iphone, one computer and the iphone are synchonized but how can I copy the contents to the second computer?

    I have two computers (1 PC and 1 iMac) and one iphone, the PC and the iphone are synchronized but I cannot copy or sync the contents to the iMac. How can I copy the contents? Can I connect the PC to the iMac so that I can use the PC as a hard-disk? Will that affect the system to work smoothly?
    Thanks

    got it fixed. didnt know that if you log in with ex. [email protected] it brings up different stuff than if you log in with 12345 as the username

  • How to copy the content in XMLtype column between databases

    Hi, there,
    Does anyone know how to copy the content in XMLtype clumn between databases? I tried insert as select via database link and it gives me the following message:
    SQL> insert into nrt_ot_request_temp (SR_ID, SR_VERSION, ITEM_NUMBER, COMMON_XML, REQUEST_XML )
    2 select SR_ID, SR_VERSION, ITEM_NUMBER, COMMON_XML, REQUEST_XML from nrt_ot_request@nrtdb_acacia;
    select SR_ID, SR_VERSION, ITEM_NUMBER, COMMON_XML, REQUEST_XML from nrt_ot_request@nrtdb_acacia
    ERROR at line 2:
    ORA-00942: table or view does not exist
    Thanks,
    Jessica

    Hi Jessica,
    in my eyes the second statement
    select ... xmlstring_column ... from table@remote_side;
    causes the error. Columns of type XMLString internally are stored as CLOBs in Oracle. Unfortunately there are restrictions on statements for CLOBs and remote locators.
    It seems you cannot say
    SELECT clob_column FROM table@remote_site;
    Remark: For me this is a showstopper for the datatype XMLString if you cannot run a simple statement like this one. It seems you can do an insert and an update but no select.
    On the other hand your first statement
    INSERT INTO table_local SELECT * FROM table@remote_site;
    should work following the documentation.
    See also
    http://docs.oracle.com/cd_a97630/appdev.920/a96591/adl04mng.htm#98328
    Best regards
    Indu Keilitz

  • Can I copy the content of my Apple TV to a new Mac?

    I have lost my entire iTunes library from a house fire, but I have my Apple TV with over 14,000 songs on it. Most from my also lost cd collection.
    Can I copy the content of my Apple TV to my new Mac? If so, how

    Not without doing things that void the warranty. You can always disassemble it, put the hard drive into an enclosure and copy things off it that way. Not for the faint of heart.

Maybe you are looking for

  • Is 8gb worth it for the new 13" Retina MBP? or should i stay at 4gb?

    So im planning on buying the new retina MBP. Really not sure if 8gb is worth it or if i should stay at 4gb. I plan on using this as my main computer for School and Home.

  • Mac Mini and Bluetooth

    Is there any other way that I can use the Bluetooth Module with out buying the complete AirPort Extream/Bluetooth Kit and without using the Bluetooth Dongle? Mac Mini 1.42 MHZ Combo Drive   Mac OS X (10.3.9)   512 MB DDR 80 GB HD

  • A way to find my previous questions and problem reports?

    Is there a way on this forum to find my previous questions and problem reports? Since posting a question earlier today, I've found MOST of the answer and would therefore like to append what I found to the question, without waiting for someone else to

  • Creating DMEE file as well as an outgoing PAYEXT idoc for payments

    We have everything set up for the creation of the DME file in the DMEE. The file is also getting created in one of the directories. Now one of the requirements is to create a PAYEXT idoc for the same information in the payment run? Can someone let me

  • Coding blocks

    Dear All, I want to add a field in posting accouting document screen for cash flow statement  purpose. which is used to classify the fund accounts.how should I do? which is the transcation code in configuration? Thanks! Fanny