Help me in Converting textarea msg to single line string

Please help me in converting the textarea message with line breaks in to single line string. because i shud pass that to the Javascript which doesnot accept line breaks.
<%
StringBuffer text = new StringBuffer(request.getParameter("textarea1"));
int loc = (new String(text)).indexOf('\n');
while(loc > 0){
text.replace(loc, loc+1, "<BR>");
loc = (new String(text)).indexOf('\n');
out.println(text);
%>

Hi,
i did not understood your problem. javascript supports \n character processing. so you should not get any error. Do one thing write a javascript function, that replaces all \n with "". this will solve your problem
funciton replaceNewLine(StringValue) {
StringValue.replace('\n','') (check replace() syntax once)
have fun!!
raj

Similar Messages

  • Converting strings with line feeds to a single line with identifying chars

    Hi, I dont want to re invent the wheel if there is something out there that does this already. I want to take some string with multiple
    line feeds and convert it to a single line. For example:
    "I want this string
    to be changed to
    a single line"
    to this...
    "I want this string\r\n to be changed tor\\n a single line"

    vsekvsek wrote:
    OK, Hope this will make better sense. So right now a I have a routine that loads files like below:
    "TEST\r\n TEST1\R\n TEST2"It's not clear to me at this point what you mean by that string.
    After the initial word TEST, does that string have a backslash character followed by an r followed by another backslash followed by an n? Or does it have a carriage return followed by a line feed. (\r followed by \n)
    We format it when loading in a way that it will look like this when queriing from the DB
    "TEST
    TEST1
    TEST2"It doesn't look like anything "when querying from the DB." That part doesn't make any sense.
    Either the string has a backslash followed by an r, in which case when you render in in a text editor or on a console it will look like a single line with a visible backslash character followed by an r, or it has a carriage return (\r) in which case it will look like multiple lines when rendered in a text editor or on a console.
    Later I re-extract it to a file from the DB and What confuses me is when I inspect the string it looks like this
    "TEST\r\n TEST1\R\n TEST2"How are you inspecting it? If it's in a debugger or similar tool, it's not uncommon for it to be showing a carriage return character (\r) as a visible backslash followed by an r, rather than interpreting it and rendering a new line. This is so that you can see exactly what characters are in there, rather than wondering about the specific whitespace.
    >
    but it extracts to my file like
    "TEST
    TEST1
    TEST2"
    So I guess there are some hidden cr's or something messing it up that I need to manipulate but not sure how to apprach it?I still don't know what you're trying to do, or if you even have an actual problem with your data or are simply not understanding what you're seeing.

  • Add Internal Table Multiple Lines into Single Line

    Hi Gurus,
    Before post this thread, i hav searched SDN but i could not find the exact solution.
    I hav an internal table, i want to add the records of this internal table into single line (string variable), separated by tab operator.
    can any one give me suggestions to solve this?
    Thanks
    Meher

    Hi,
    Program should be some thing like below:
    REPORT  ZTEST36.
    *-- test program to concatenate internal table to string.
    DATA:STRING TYPE STRING.
    TYPES:BEGIN OF TY_ITAB,
          WEEK(15),
          END OF TY_ITAB.
    DATA:GT_ITAB TYPE STANDARD TABLE OF TY_ITAB WITH HEADER LINE.
    CLEAR GT_ITAB.
    GT_ITAB-WEEK = 'SUNDAY'.
    APPEND GT_ITAB.
    CLEAR GT_ITAB.
    GT_ITAB-WEEK = 'MONDAY'.
    APPEND GT_ITAB.
    CLEAR GT_ITAB.
    GT_ITAB-WEEK = 'TUESDAY'.
    APPEND GT_ITAB.
    CLEAR GT_ITAB.
    GT_ITAB-WEEK = 'WEDNESDAY'.
    APPEND GT_ITAB.
    CLEAR GT_ITAB.
    GT_ITAB-WEEK = 'THURSDAY'.
    APPEND GT_ITAB.
    CLEAR GT_ITAB.
    GT_ITAB-WEEK = 'FRIDAY'.
    APPEND GT_ITAB.
    CLEAR GT_ITAB.
    GT_ITAB-WEEK = 'SATURDAY'.
    APPEND GT_ITAB.
    CLEAR:GT_ITAB, STRING.
    LOOP AT GT_ITAB.
      CONCATENATE STRING '/' GT_ITAB INTO STRING.
    ENDLOOP.
    WRITE: / STRING.
    Regards
    Ramesh.
    Moderator message - Ramesh - please use code tags
    Edited by: Rob Burbank on Jul 3, 2009 12:26 PM

  • Help convert spread pages to single pages when converting Indesign to PDF for printer

    I have an Indesign booklet of 28 pages which I need to convert to pdf as single pages so I need to turn off the spread pages/facing pages option so I can convert to pdf to get it printed.  I know how to turn the spread/facing pages off but when I do this it affects the master page and all the pages become left hand pages and the headers/page nos are in the wrong place.  I have looked at numerous websites/blogs and everyone seems to have the same problem.  Can anyone help me please as this is really urgent now?

    Actually, you DON'T want to undo the facing pages. Just export using the settings recommended by the printer and you'll get one PDF with individual pages, not spreads, as long as the Spreads box is not checked.

  • Need Help importing data using PHP to convert it into a single HTML line

    Hi, My names Chance
    I'm a 2nd year web design student and have been assigned a project by my teacher for a charity website
    i found a tutorial of exactly what i need to do but im stuck on creating a script to import  and convert php data
    to a single html line
    heres the link to the the script, if you scroll down to the bottom
    where it says
    RSS or XML Data Source
    "The scrolling text can be imported from any source: RSS, XML or any other format.
    For example, if you want to import data using PHP to convert it into a single HTML line to be displayed by the ticker, create a php script to import and convert the data, and include it directly in the DIV tag as follow"
    this is what i need help doing
    http://www.mioplanet.com/rsc/newsticker_javascript.htm
    i already have the php code that i want to import
    i just need to know how to import and convert my php script so im able
    to make the the javascript from the link i provided to work
    thank you so much for your time
    if you have any question or answer please email me
    [email protected]
    thanks again hope to here from you soon

    Hi
    The instructions are there on the page you provided a link to!
    What is it you do not understand?
    PZ
    www.pziecina.com

  • Converting Outlook .msg files to .one files

    Hello,
    I am facing a few difficulties regarding the conversion of .msg files to .one files.
    A colleague of mine is using around 200 .msg files which he could view on his phone but since that suddenly did not work, I am tasked with converting those .msg files to .one (or a file format that is compatible with OneNote).
    I then encountered the possibility of converting .msg files to .pdf, but you can't edit .pdf files within OneNote (therefore requiring another conversion progress).
    Also I'd like, if possible, to convert the .msg files in one large batch without having to click and convert every single one of them (could be done but would take a while though).
    If there are any questions, feel free to ask!

    Hi,
    I haven't found a method to directly convert .msg file to .one files. However, as a workaround, we can try inserting these .msg files as printouts in OneNote notebook. To do this, click Insert tab > File Printout button, then, hold Ctrl key and select
    all the .msg files you want to import into OneNote. Click Insert button.
    Regards,
    Steve Fan
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]
    Hello Steve,
    I have already converted the Outlook notes to .doc format with a third party tool (it was a big hassle but I am one step closer to importing them in OneNote).
    At the moment, I'm importing the Outlook notes into OneNote which will take a while since there around 270 notes.
    I'll keep you posted when it's done or I have tried something else.

  • Convert  multiple rows into single rows for the respective index name

    Dear Experts,
                             I want to convert  multiple rows into single rows for the respective index name,
                            Here is my query.
    SELECT user_tables.table_name, user_indexes.index_name, user_ind_columns.column_name
    FROM user_tables
    JOIN user_indexes on user_indexes.table_name = user_tables.table_name
    join USER_IND_COLUMNS on USER_INDEXES.INDEX_NAME = USER_IND_COLUMNS.INDEX_NAME
    where user_indexes.index_name not like '%PK%' AND user_ind_columns.column_name NOT LIKE '%SYS%'
    ORDER BY user_tables.table_name,user_indexes.index_name;
    Result of previous query
    TABLE_NAME
    INDEX_NAME
    COLUMN_NAME
    T1
    IDX_ACCNTYPCFG1
    ENABLE_SERVICE
    T1
    IDX_ACCTTYPCFG1
    ACC_CODE
    T1
    IDX_ACCTTYPCFG1
    ACCTYPE
    T2
    IDX_ACCTTYPCFGAPP1
    ACCTYPE
    T3
    IDX_ACTLG1
    MOBILE_NO
    T3
    IDX_ACTLG1
    ID
    Desired output required is
    TABLE_NAME
    INDEX_NAME
    COLUMN_NAME
    T1
    IDX_ACCNTYPCFG1
    ENABLE_SERVICE,ACC_CODE,ACCTYPE
    T2
    IDX_ACCTTYPCFGAPP1
    ACCTYPE
    T3
    IDX_ACTLG1
    ACCTYPE,MOBILE_NO
    please help.

    Maybe
    with
    user_tables as
    (select 'T1' table_name,'IDX_ACCNTYPCFG1' index_name,'ENABLE_SERVICE' column_name from dual union all
    select 'T1','IDX_ACCTTYPCFG1','ACC_CODE' from dual union all
    select 'T1','IDX_ACCTTYPCFG1','ACCTYPE' from dual union all
    select 'T2','IDX_ACCTTYPCFGAPP1','ACCTYPE' from dual union all
    select 'T3','IDX_ACTLG1','MOBILE_NO' from dual union all
    select 'T3','IDX_ACTLG1','ID' from dual
    select table_name,
           case index_name when 'IDX_ACCNTYPCFG1' then 'IDX_ACCTTYPCFG1' else index_name end index_name,
           listagg(case column_name when 'ID' then 'ACCTYPE' else column_name end,',') within group (order by null) column_name
      from user_tables
    group by table_name,case index_name when 'IDX_ACCNTYPCFG1' then 'IDX_ACCTTYPCFG1' else index_name end
    TABLE_NAME
    INDEX_NAME
    COLUMN_NAME
    T1
    IDX_ACCTTYPCFG1
    ACCTYPE,ACC_CODE,ENABLE_SERVICE
    T2
    IDX_ACCTTYPCFGAPP1
    ACCTYPE
    T3
    IDX_ACTLG1
    ACCTYPE,MOBILE_NO
    Regards
    Etbin

  • Convert group items to single object?

    In order to make both sides of this shape symmetrical, I drew half of it with the pen tool, then did a copy/paste. I rotated the second piece horizontally, then aligned them to give the appearance of a sinlge item. I want to convert this to a single object so I can apply a gradient effect to it. Can someone help me? Here's what I have:

    Pathfinder Merge is just an effect. It doesn't join things physically.
    Merge (in the Pathfinder palette) is not a live effect. And it does "join things."
    Merge unions (add) contiguous areas of same-colored fills and punches (subtract) overlapping areas of different-colored fills.
    So in effect, it creates paths which are actually shaped like what you see, in terms of regions of contiguous fills. It "merges" areas of same color that touch, and removes any overlaps.
    (This is particularly useful in prepping artwork for vinyl cutting, because it eliminates crosscuts and overlaps. I have long argued that it should provide a settings dialog to make overlap optional and adjustable so that in such situations, it could serve to build traps at the same time, which is usually needed in artwork assembled from vinyl.)
    Like most Pathfinders, it can only work with fills; it doesn't properly handle strokes, so it wrecks artwork containing strokes. You have to use Outline Stroke before you use Merge if you don't want to loose strokes.
    I would not, however, have suggested Merge for TC's situation, because it would not perform the union if the two paths had different fills. Union (Pathfinder Add) is the normal and customary way to do this.
    As for those situations in which abutting edges may not perfectly align, I often simply draw a third path that overlaps the two being unioned using any closed path drawing tool to make sure of there being overlap; then do the union on the three paths; then use the minus pen tool to remove any unwanted anchors. That is often simpler than tedioiusly aligning anchors, which often doesn't work anyway because a single slightly extended control handle can cause the edges to misalign. It helps ensure you don't accidently create a compound path instead.
    JET

  • Help me to convert this???

    Hi,
    This is the VB6 statement I have.
    m_conApp.Forms.ActiveForm.Items.Item("5").Specific.String = "Something"
    So please help me to convert this into c#. becauses it causes some confusions for me and difficult to find a solution from SDK help center.
    regards
    Chamara

    Hi Chamara,
    i know its confusing when you move to c#
    correct is
    ((SAPbouiCOM.EditText)(globals.SBO_Application.Forms.ActiveForm.Items.Item("5").Specific)).String
    lg David

  • Help needed in converting a psd file to php layout

    I have a website Inspire2rise dot com . I recently came across a beautiful PSD file that I wanted to apply to my site's design. My site is based on WordPress. Is there any tool which can help me in converting the psd file to WordPress compatible theme?

    Tools: https://www.google.com/search?client=safari&rls=en&q=psd+to+wordpress&ie=UTF-8&oe=UTF-8
    Tutorials: https://www.google.com/search?client=safari&rls=en&q=psd+to+wordpress+tutorial&ie=UTF-8&oe =UTF-8

  • Help needed in converting Excel from XML file

    Hi Can anyone help me in converting XML in to Excel.
    Thanx,
    Ananth.

    well, that still isn't much to go off of. I give it a try though.
    I guess you want to parse out the relevent data out of the xml file and then decide on your favorite delimated file format for Excel. Two popular formats are comma delimated:
    "info1","info2","info3","info4"
    and tab delimeted:
    info <tab> info2 <tab> info3 <tab> info4
    Excel should be able to unsestand either of these formats.

  • Help needed in converting date to number

    Hi,
    I am trying to execute the below query, its failing with "invalid number" error.
    select * from process_status
    where time_process > to_char('&3','yyyymmdd')
    time_process is the "number" datatype.
    Details:
    SQL> select * from process_status
    2 where time_process > to_char('&3','yyyymmdd');
    Enter value for 3: 01-MAY-09
    old 2: where time_process > to_char('&3','yyyymmdd')
    new 2: where time_process > to_char('01-MAY-09','yyyymmdd')
    where time_process > to_char('01-MAY-09','yyyymmdd')
    ERROR at line 2:
    ORA-01722: invalid number
    If I execute the below query its working fine, I am facing problem only when I pass the date explicitly to the query. Please help me on converting the date to number format.
    select * from etl_process_status
    where time_process > '20090501'
    and rownum < 3;
    Thanks

    as others have said, it would be best to have your time_process column stored as a date in oracle, if it contains dates.
    The reason for this is because if you store your dates as a number, you have removed information from Oracle that says "This is a date", so when Oracle comes to try and estimate the number of rows greater than a specific value, it can no longer guess correctly, since it's basing its guess on that column being a number.
    There are lots more numbers between '20091201' and '20091101' than there are days between 1st November and 1st December.
    By hiding the fact that your data is a date, you could throw your execution plan off and end up with sub-optimal performance.
    In short, store your data in the correct column format!

  • Converting multiline text string to single line

    How do I convert a multiline text string into a single line text string

    Hi Bart,
    what's a multiline text string?
    1) You have an array of string: simply use "string concatenate" to convert from array to scalar string.
    2) Your string contains CR and/or NL characters: use "Search/Replace..." for this string, replace all EndOfLine chars by space (or which char you may prefer)...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Help me to convert Java and Jsp Files into WAR File!!!!

    I need someone to help me to convert some java servlet files and jsp files into a WAR file. I need it URGENTLY and I'll be very grateful to anyone who is willing to help me! My email is [email protected] Thanks!!!!

    Are the Oracle JDBC drivers 11g used?
    oracle.jdbc.driver.OracleDriver is not supported in 11g drivers.
    Please replace with:
    oracle.jdbc.OracleDriver

  • HELP!! convert selection to AAC wont work

    I NEED 2 KNOW HOW 2 DO THIS IT WONT WORK IT SAYS THAT THERE IS AN ERROR WHAT DO I NEED 2 DO?? I DOWNLOADED A VIDEO AND ITS ON I-TUNES BUT IT WONT PUT IT ON MY I-POD CAN ANY ONE HELP???!!??

    HELP!! convert selection to AAC wont work
    Why do you want to convert it to AAC?
    Why not convert it for iPod?
    IT SAYS THAT THERE IS AN ERROR
    What exactly is the error?
    I DOWNLOADED A VIDE
    From iTunes Music Store?
    What format is it now?

Maybe you are looking for

  • Reconciliation account

    Hi gurus, user wants to eliminate the reconciliation acccount Asset in Control data of GL Master. He wants to post directly to that GL account so that he is asking to eliminate the reconciliation account from the GL master. What will be the impact on

  • How do I set the environment to change outputs when I press a button?

    Hi guys! This is a question for the Logic pros: How do I set up my environment so that when I press a Button on my Midi Controller the Outputs from the Master Channel switch from 1-2 to 3-4 (to hear my music through different loudspeakers)??? Does so

  • Need help in tune this query.

    Hi All, The below query is taking nearly one hour to give the output.   2  select sku.VK_UNIT   3       , sku.MODEL   4       , sku.DESCRIPTION   5       , slt.GEO   6       , slt.LEAD_TIME   7       , slt.REV_LEAD_TIME   8       , aud.LEAD_TIME     

  • Clear recent search history in google search bar

    Would someone know how to clear the recent search history in the Google search bar? There is no option for clearing the recent search, I think that was eliminated. I cleared the cache, in Safari, but that doesn't clear the google search bar. Is there

  • Insert at BWF Time Offset - Not working!

    I have some broadcast wave files generated with Cubase 5, and they definitely have BWF time offset. I can see it in File Info. When I select the option to Use BWF Time Reference Offset, and then attempt to insert the file, it just inserts at the curs