Visit Our UNIX and Linux User Community

Top Forums Shell Programming and Scripting Changing paragraph to a width of 80 character Post 302848379 by kristinu on Thursday 29th of August 2013 06:50:11 AM
Old 08-29-2013
Changing paragraph to a width of 80 character

I have the following text file and want to change the paragraphs so that
they fill 80 characters rather than the usual 65 in this case. Is there an easy way to do this?

All three groups were distinguished by the remarkable
manner in which they moved about on the solar surface, not
only in longitude but also in latitude.
The first group moved forward 5°"2 in longitude, and o 0 ·6
upward in latitude, in· the four days following its formation.
In the fortnight that it was on the further side of the Sun
it moved forward 4°"0 in longitude, and 1°"1 downward in
latitude. It was no'Y a single circular spot, and remained nearly
stationary till its disappearance.
The second group, that of June 16, the principal group of
the year, showed the most extraordin,ary drift, as the first
diagram will show.
Some of the minor irregularities are probably due to faculous
or photospheric mat,ter drifting above portions of the group
and concealing certain di.stricts of it, revealing them again
by their witharawal later on. But as for the greater part of
its history, tbe group practically consisted of but one welldefined circular 
spot, there can be no doubt that the apparent
change of place from day to day corresponds very closely to
the real movement of the centre of the group upon the
solar surface. In this and in the second diagram the observed
positions for the first and last days at each appearance are not
given, as only a portion of the group was visible on some of
those occasions, and the centre of the part observed was therefore
not the true centre of the group.

The third group of long duration, that of August z, was a very
perfect example, of the type above described. The first faint
spots were seen on .August 2. By August 4 the long stream of
spots with a large spot at either end had fully formed ; and by
August I 1 the leader alone remained. During the next rotation
the group consisted only of one large circular well-defined spots.
At its third appearance this circular spot was preceded by a
number of small spots, but. after September 26 the entire group,
and especially the smaller spots, began to diminish, and the
group had disappeared before reaching the west limb. The most
striking feature in ·the history of the group was the rapid backward drift 
shown after its first appearance The forward move ..
ment during the· first: rotation, the r~t.rogression whilst on _the

Test Your Knowledge in Computers #550
Difficulty: Medium
The string concatenation operator can sometimes be combined with non-string types; numerical types.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Changing particular field in fixed width file

I have a fixed width file and i need to change 36th field to "G" in for about random 20 records? How can I do it? (4 Replies)
Discussion started by: dsravan
4 Replies

2. Linux

Extract a paragraph

Hi , has been life saver for me I admit :) I am trying to extract a paragraph based on matching pattern "CREATE TABLE " from a ddl file . The paragraphs are seperated by blank line . Input file is #cat zip.20080604.sql1 CONNECT TO TST103 SET SESSION_USER OPSDM002 ... (2 Replies)
Discussion started by: capri_drm
2 Replies

3. UNIX for Dummies Questions & Answers

Split a paragraph

Hi, Consider the following paragraph. This is line1. This is line2, This is last line. I need the output as 4:This is last line. i.e The line after the blank line should be displayed along with line number. I am a unix begineer.Any one please help me to solve this problem (3 Replies)
Discussion started by: Sekar1
3 Replies

4. Shell Programming and Scripting

Changing one column of delimited file column to fixed width column

Hi, Iam new to unix. I have one input file . Input file : ID1~Name1~Place1 ID2~Name2~Place2 ID3~Name3~Place3 I need output such that only first column should change to fixed width column of 15 characters of length. Output File: ID1<<12 spaces>>Name1~Place1 ID2<<12... (5 Replies)
Discussion started by: manneni prakash
5 Replies

5. UNIX for Dummies Questions & Answers

Output text from 1st paragraph in file w/ a specific string through last paragraph of file w/ string

Hi, I'm trying to output all text from the first paragraph in a file that contains a specific string through the last paragraph in that file that contains that string. Previously, I was outputting just each paragraph with that search string with: cat in_file | nawk '{RS=""; FS="\n";... (2 Replies)
Discussion started by: carpenn
2 Replies

6. Shell Programming and Scripting

Changing the character after the Underscore(_)

Hi Everyone, I am looking for a command that would do the following: 1) Change all the letters/words in a file to Lower case Letters/words. 2) Remove the Underscore (_) and Change the Character after the underscore (_) to an Uppercase letter. Example: File contains the below words: ... (5 Replies)
Discussion started by: filter
5 Replies

7. Shell Programming and Scripting

Remove new line character and add space to convert into fixed width file

I have a file with different record length. The file as to be converted into fixed length by appending spaces at the end of record. The length should be calculated based on the record with maximum length in the file. If the length is less than the max length, the spaces should be appended... (4 Replies)
Discussion started by: Amrutha24
4 Replies

8. Programming

Changing double to character string in C++

I want to convert an double to a character string. I done the integer and float ones using itoa and ftoa. How can I do a similar thing with doubles? String::String ( const float f ) { char *cdata = ftoa (f); strcpy (STR, cdata.c_str ()); } String::String ( const double ... (1 Reply)
Discussion started by: kristinu
1 Replies

9. Shell Programming and Scripting

Compare a paragraph

I know this is a challenging, its about comparing a 3 paragraph, from a whois command, i want to print what is the data that is not unique, example below is the admin phone and techphone, the rest is the will print the correct and wrong # whois| sed -n '/Registry Registrant... (3 Replies)
Discussion started by: kenshinhimura
3 Replies

10. Red Hat

How to know full width blade or half width blade?

HI, How do we figure out if the server is half blade server or full blade server? Anything we need to look at to know on this? thanks in advance (9 Replies)
Discussion started by: snchaudhari2
9 Replies
setregid(2)							System Calls Manual						       setregid(2)

       setregid - set real and effective group ID

       setregid(rgid, egid)
       int rgid, egid;

       The real and effective group ID's of the current process are set to the arguments.

       Supplying a value of -1 for either the real or effective group ID forces the system to substitute the current ID for the -1 parameter.

       If  the	process is superuser, or and matches with the real group ID, the effective group ID, or the saved set-group-id (as described in ),
       then the real, effective, and saved set-group-id are set to and respectively.

       When your program is compiled in POSIX or SYSTEM-FIVE mode, the following semantics apply when using the function.

       If the process is the superuser, the real, effective, and saved set-group-id (as described in ) are set to and respectively.

       If the process is not the superuser, but the and matches the real group ID, the effective group ID (only in SYSTEM-FIVE	and  BSD  environ-
       ment), or the saved set-group-id, then the effective ID is set to The real group ID and the saved set-group-id are left unchanged.

Return Values
       Upon successful completion, a value of zero (0) is returned.  Otherwise, a value of -1 is returned, and errno is set to indicate the error.

       [EPERM]	      The  current process is not the superuser and the and specified does not match with the real group ID or the effective group
		      ID (only in SYSTEM-FIVE and BSD environment) or the saved set-group-id.

See Also
       getgid(2), setreuid(2), setgid(3)


Featured Tech Videos

All times are GMT -4. The time now is 05:24 AM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy