How do I get long command lines to wrap to the next line?

1

my prompt is not wrapping properly and not moving onto the second line, instead overwriting the first line. There are some other funky behaviors too. Can someone who's got experience with PS1 profiles spot what's wrong here?

once i do emacs .bash_profile, this is the relevant line:

export PS1="\\e[1;34m[\@ \u \W]\$ \e[m\]\]"

I've followed the advice here (http://unix.stackexchange.com/questions/105958/terminal-prompt-not-wrapping-correctly) to close all my brackets on both sides, and also tried this (http://askubuntu.com/questions/24358/how-do-i-get-long-command-lines-to-wrap-to-the-next-line) and made sure I have \\[ preceding everything/my color choice.

Any ideas?

Much...

0 0
2

Possible Duplicate:
How do I get the input to cut off or wrap around at a certain point?

Alrighty, so after a day and a bit of being on stackoverflow, I learned it's useful being on this site :) I ended up getting my program to work. I can get an unlimited amount of text files in on the command line and display them as well! So it looks like this

I have:

CMD Console

c:\Users\Username\Desktop> wrapfile.exe hello.txt how.txt. are.txt you.txt random.txt

Hello How are you doing today? I hope you're doing quite well. This is just a test to see how much I can fit on the screen.

I need:

CMD Console

c:\Users\Username\Desktop> wrapfile.exe hello.txt how.txt. are.txt you.txt random.txt

Hello How are you doing today?
I hope you're doing quite well.
This is just a test to see how
much I can fit on the screen.

Now, I wana build on this program. How would I get this new found text to wrap around? Like,...

0 0
3

Question

I need to write different paragraphs of text within a certain area. For instance, I have drawn a box to the console that looks like this:

/----------------------\ | | | | | | | | \----------------------/

How would I write text within it, but wrap it to the next line if it gets too long?

Answer

Split on last space before your row length?

int myLimit = 10; string sentence = "this is a long sentence that needs splitting to fit"; string[] words = sentence.Split(new char[] { ' ' }); IList sentenceParts = new List(); sentenceParts.Add(string.Empty); int partCounter = 0; foreach (string word in words) { if ((sentenceParts[partCounter] + word).Length > myLimit) { partCounter++; sentenceParts.Add(string.Empty); } sentenceParts[partCounter] += word + " "; } foreach (string x in sentenceParts) Console.WriteLine(x);

UPDATE (the solution above lost the last word in some...

0 0
4

Split on last space before your row length?

int myLimit = 10; string sentence = "this is a long sentence that needs splitting to fit"; string[] words = sentence.Split(new char[] { ' ' }); IList sentenceParts = new List(); sentenceParts.Add(string.Empty); int partCounter = 0; foreach (string word in words) { if ((sentenceParts[partCounter] + word).Length > myLimit) { partCounter++; sentenceParts.Add(string.Empty); } sentenceParts[partCounter] += word + " "; } foreach (string x in sentenceParts) Console.WriteLine(x);

UPDATE (the solution above lost the last word in some cases):

int myLimit = 10; string sentence = "this is a long sentence that needs splitting to fit"; string[] words = sentence.Split(' '); StringBuilder newSentence = new StringBuilder(); string line = ""; foreach (string word in words) { if ((line + word).Length > myLimit) { newSentence.AppendLine(line); line = ""; } line += string.Format("{0} ", word); } if (line.Length >...
0 0
5

To wrap text to a notebook window size, select > . If you use text wrapping and resize your notebook, MuPAD® automatically adjusts text lines to a new window size. This option affects text regions only.

When you wrap text in a notebook, and then unwrap it, the vertical line appears. This line shows you the position of the right margin of the current page format.

When you print the page, MuPAD lets you choose between scaling down the whole page or cropping the content to the right of the line. The line does not appear on printed pages. To remove this line, select > .

To wrap the contents of the input regions to a notebook window size:

Select > .

In the resulting dialog box, click the Calculations tab.

From the drop-down menu Format, select Input Paragraph.

Select the Word wrap check box.

Now MuPAD wraps all new expressions and commands in the input regions to a notebook window size. If you use wrapping for input regions and...

0 0
6

If you use Microsoft Excel to organize data (say, a list of documents being produced), you may have run across The Cell That’s Too Small For Its Data. You know, you’ve got a bunch of stuff typed into a cell (not because you’re rambling, but because you need all that information, dang it), and it just breaks out of the borders of the cell and keeps on going:

And if that’s not annoying enough, if you have to type something into the cell to the right, then you’ve just cut off the last part of that other cell:

What you want to be able to do is have the information in the first cell wrap so it appears on multiple lines within that cell. Right?

Here are a couple of different tricks to try:

Wrap text. If it really doesn’t matter where the line wraps (as long as everything stays within the same cell), then the thing to do is format the cell so that the text wraps automatically. Although the different versions of Excel (from 2002 through 2013)...

0 0
7
instead of hitting enter

hit

Alt Enter

hit those 2 keys together, and you wont get bumped out.
the spaces is not a good idea.
hope this helps.

edit-
the example didnt have any indents, but isee what you are saying.

i think you will need the spaces after all.

since its a text only box, it shouldnt have any affect on your excel file. just make sure your print preview looks cool, and it will be ok.
the only time it will ever cause a problem is if you are ever going to have to cut and paste it somewhere other than excel.

edit again
1. yahoo kinda sucks at that.
.........most people put a bunch of dots, and say dots
.........represent spaces

edit-
you probably want to be using word for this.
but since we are in exce heres some ideas.
1. start over on a clean new sheet
2. this might be a rare case where you might want to merge cells
.....2a highlight like 5...

0 0
8

Hello Carl and All,

Don’t be sad ! In addition to the suggestions of Tomas and Jim, there are TWO other means to get the job done. Indeed !

With a Search/replacement, using regular expressions ( I’ll explain two kinds of wrapping ).

With the N++ native split feature, by the menu option Edit - Line Operations - Split Lines.

Let’s take an example, for better understanding. We’ll adopt some preliminary hypotheses, below :

Text is supposed to be “normal”. I mean, preferably, not language source code, lists in columns, poems or any specific text like these ones !

The blank character, used in text, is the classical SPACE character ( \x20 ). To be sure that this second hypothesis is verified, use the intelligent (Thanks to Loreia2 ! ) replacement of Tabulation characters by spaces ( Menu option Edit - Blank Operations - TAB to Space ), which keeps the original location of any NON blank character !

If your text is pure text, without...

0 0