Sponsored Content
Full Discussion: replace space for enter
Top Forums Shell Programming and Scripting replace space for enter Post 302437333 by j_jiffer on Wednesday 14th of July 2010 04:43:10 PM
Old 07-14-2010
Maybe your problem is in the actual HTML? If you're using the results straight from sed, you're probably getting something like this:

Code:
<div id="blablabla">
/home/user
/home/user/dir
</div>

And if that's the case, you're missing the <br /> tag that signals a line break in HTML. If I remember correctly, implicit line breaks like the ones above turn into spaces when HTML is rendered on to a webpage.

So, if this is your problem, try replacing the spaces with "<br />" instead of newlines.

Last edited by j_jiffer; 07-14-2010 at 05:58 PM.. Reason: typo
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

replace space by _

Hi I need to know how I change the spaces by _ in folders and filder founded by find ex. find . -name "* *" -exec echo {} \; ./test space ./test space/new file.txt ./test space/new file ./test space/untitled folder ./test space/untitled folder/new fileruben ./Backup/backup/Image... (6 Replies)
Discussion started by: ruben.rodrigues
6 Replies

2. Shell Programming and Scripting

Replace space

Hai masters, If a file contains content of 2000 lines, from which i need to remove the first n characters or first n spaces from each line of the file. If suppose to remove n characters or first n spaces from a single line means, just use the command nx. But from the above scenario,... (9 Replies)
Discussion started by: ecearund
9 Replies

3. Shell Programming and Scripting

Pressing "Enter/Space bar" using Net::TELNET? in Perl

I'm trying to learn how to get my script to execute the enter button when it telnets into a router and the router displays output but you need to press the space bar or enter button to continue displaying my output of the router. How is this done? (0 Replies)
Discussion started by: xmaverick
0 Replies

4. Shell Programming and Scripting

Replace long space to become one space?

Hi, i have the log attached. Actually i want the long space just become 1 space left like this : Rgds, (12 Replies)
Discussion started by: justbow
12 Replies

5. Shell Programming and Scripting

Replace every other space

I'd like a sed command to replace every other space in my file. File: 0 1 0 3 0 2 0 5 Want: 01 03 02 05 Does anyone have any ideas? (9 Replies)
Discussion started by: peanuts48
9 Replies

6. Programming

Replace one space with nothing

hi, d o g e v o l i want a perl command for the above string which should change to the below dog evol replace one space with nothing and two spaces with one space. Thanks, Amey (3 Replies)
Discussion started by: ameyrk
3 Replies

7. UNIX for Dummies Questions & Answers

replace %20 with space

Hi, I need torename filenames with %20 to space in a batch wise.Can anyone help me please. Need it badly Eg. English%20Brochure%20002-1 to be replace to English Brochure 002-1 Thanks a lot Please use and tags when posting code, data or logs etc. to preserve formatting... (8 Replies)
Discussion started by: umapearl
8 Replies

8. Shell Programming and Scripting

function terminating if i give input as space or no input and enter

HI i have written a script to ask input from the user. this script should promote the user for y/n input. if user enters anyother input then y/n the script promotes him again. this below code is working fine for all the cases. except for space and enter " if i give space and enter it is... (2 Replies)
Discussion started by: BHASKARREDDY006
2 Replies

9. Shell Programming and Scripting

Transpose multiple rows (with a mix of space and enter) to a single column

How to change the uploaded weekly file data to the following format? New Well_Id,Old Well_Id,District,Thana,Date,Data,R.L,WellType,Lati.,Longi. BAG001,PT006,BARGUNA,AMTALI,1/2/1978,1.81,2.29,Piezometer,220825,901430 BAG001,PT006,BARGUNA,AMTALI,1/9/1978,1.87,2.29,Piezometer,220825,901430... (3 Replies)
Discussion started by: sara.nowreen
3 Replies

10. Shell Programming and Scripting

Loop logic, enter into respective IF as per enter input file name

have three big data file, however I just need to see the mentioned below one line form the all the file which has SERVER_CONNECTION Value File 1 export SERVER_CONNECTION=//dvlna002:10001/SmartServer File2 export SERVER_CONNECTION=///SmartServer File3 export... (1 Reply)
Discussion started by: Nsharma3006
1 Replies
NL2BR(3)								 1								  NL2BR(3)

nl2br - Inserts HTML line breaks before all newlines in a string

SYNOPSIS
string nl2br (string $string, [bool $is_xhtml = true]) DESCRIPTION
Returns $string with '<br />' or '<br>' inserted before all newlines ( , , and ). PARAMETERS
o $string - The input string. o $is_xhtml - Whether to use XHTML compatible line breaks or not. RETURN VALUES
Returns the altered string. EXAMPLES
Example #1 Using nl2br(3) <?php echo nl2br("foo isn't bar"); ?> The above example will output: foo isn't<br /> bar Example #2 Generating valid HTML markup using the $is_xhtml parameter <?php echo nl2br("Welcome This is my HTML document", false); ?> The above example will output: Welcome<br> This is my HTML document Example #3 Various newline separators <?php $string = "This is a string "; echo nl2br($string); ?> The above example will output: This<br /> is<br /> a<br /> string<br /> CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.3.0 | | | | | | | Added the optional $is_xhtml parameter. Before | | | this version '<br />' was always inserted. | | | | +--------+---------------------------------------------------+ SEE ALSO
htmlspecialchars(3), htmlentities(3), wordwrap(3), str_replace(3). PHP Documentation Group NL2BR(3)
All times are GMT -4. The time now is 11:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy