Sponsored Content
Top Forums Shell Programming and Scripting Align or move paragraph right Post 302608501 by lostincashe on Saturday 17th of March 2012 04:44:32 PM
Old 03-17-2012
Yes sorry hard to demonstrate, here is some more example.
If I have a file which I want to search for patterns located in paragraphs patterns - bobby, larry, sally. using command
Code:
sed -e '/./{H;$!d;}' -e 'x;/bobby/!d;/larry/!d;/sally/!d'

I get an output with all paragraphs containing these patterns like this

Bobby is 8 years old
and now gos to school.

Larry is 6 years old and
has just started school.

Sally is 7 and
she likes school alot.

Larry favorite subject is
PE as he gets to play soccer.

I would like to offset or center paragraphs using SED containing "Larry" so it looks like this a

Bobby is 8 years old
and now gos to school.
Larry is 6 years old and
has just started school.
Sally is 7 and
she likes school alot.
Larry favorite subject is
PE as he gets to play soccer.
Thankyou for any help

Last edited by Franklin52; 03-22-2012 at 04:19 AM.. Reason: Please use code tags for code and data samples, thank you
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Align Text from a file.

I need to align text from a file that has columns seperated by spaces and commas. Any ideas? Text is similar to this. File Name is Test. 05/14/06 13:46:56.575 ,TEST,5,123,1234,123,12345,12,12.2,2.1,4.5,5.23 05/14/06 13:49:58.009 ,TEST,6,456,456.7,45,4.56,453,34,54.3,3.2,6.456 (9 Replies)
Discussion started by: earlepps
9 Replies

2. 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

3. Shell Programming and Scripting

Align the words

HI , I am new to shell scripting i m getting the below format like this Name FirstName Lastname ------ --------- ---------- Name1 Balaji NandaKishore Name123 Vijaya krsihna ... (5 Replies)
Discussion started by: Lucky123
5 Replies

4. Shell Programming and Scripting

Align with printf or other method

below line is one by one print audio_play PASS boot_check FAIL ethernet_change_mac NIC_82574L PASS gps_ublox_neo FAIL storage_bonnie USB2 PASS storage_copy_big_file USB2 PASS I would like below format ... (7 Replies)
Discussion started by: yanglei_fage
7 Replies

5. Shell Programming and Scripting

Better Align--output of find command

Hi, i have sh program which search for a file in a folder structure and provides its path. This is just used to see if that file exits more that once anywhere down the folder structure. I have used find command to search & printing it output on terminal. I have attached screen shot of it.... (10 Replies)
Discussion started by: praveenkumar198
10 Replies

6. Shell Programming and Scripting

Align data of the paragraph

Hi, I need your help to align data from paragraph. It's to : - delete the lign contain NDS - align data between paragraph start to "ND=" from second "ND=" example of file: @ ABOIL; @ CEN=1/15-05-23/09 H 06 MN 18/LISTAGE CARACTERISTIQUES D'ABONNES TRAITEMENT TGLAIL ACC... (1 Reply)
Discussion started by: vremen3
1 Replies

7. Shell Programming and Scripting

Align columns

Hi, I have a question on how to align columns in shellscipt. SAMPLE 2015-07-15 09:01:00.0 |TCSERVER01 |10965 2015-07-15 09:02:00.0 |TCSERVER01 |4752 2015-07-15 09:03:00.0 |TCSERVER01 |4805 2015-07-15 09:04:00.0 |TCSERVER01 |3690 2015-07-15 09:01:00.0 |TCSERVER02 |8703 2015-07-15... (1 Reply)
Discussion started by: reignangel2003
1 Replies

8. Shell Programming and Scripting

Align input fields on one under each other

Hello again, I'm having a issue with a contact form. I want the input fields to be aligned on same row and I really dont know how to do it. I attached a image for you to understand what i am trying to do. <BR> <label for="name" class="required"> Name&nbsp;<strong... (1 Reply)
Discussion started by: galford
1 Replies

9. Shell Programming and Scripting

Re align in one row using sed

Hi, Anyone can help on how to re align my data in one row using sed. test.csv "url1","abc","project url1" 2016-08-16 "url2,"microsoft","project url2" 2016-08-18 need output like this "url1","abc","project url1","2016-08-16" "url2,"microsoft","project url2","2016-08-18" Thanks in... (8 Replies)
Discussion started by: fspalero
8 Replies

10. Shell Programming and Scripting

Align columns

I have a text file that I filtered using awk. I only exctracted two columns. I want those two columns to be aligned. Most of the answers I found was to use `column -t` command. I tried that but I am getting a `bash: column: command not found`. Is there another way to align columns... (1 Reply)
Discussion started by: erin00
1 Replies
align(3U)						    InterViews Reference Manual 						 align(3U)

NAME
AlignCmd, AlignToGridCmd - commands for aligning interactors to each other and to a grid SYNOPSIS
#include <Unidraw/Commands/align.h> DESCRIPTION
AlignCmd is a purely interpretive command for aligning selected components with respect to one another. For example, it can align the left sides of selected components so that they coincide. AlignToGridCmd is interpreted by selected GraphicView objects to align themselves to the grid (if any) associated with the viewer in which they appear. Each component can thus define what it means to align itself to the grid. ALIGNCMD PUBLIC OPERATIONS
AlignCmd( ControlInfo*, Alignment reference = Left, Alignment affected = Left ) AlignCmd(Editor* = nil, Alignment = Left, Alignment = Left) The constructor takes optional arguments for specifying the alignment desired. The reference parameter specifies a point on a fixed reference component. The affected parameter specifies a point on components that will move to realize the alignment. The defaults for these parameters specify that all affected components should align their left sides to reference's left side. void GetAlignment(Alignment&, Alignment&) Return the alignment parameters specified in the constructor. GraphicComp* GetReference(GraphicComp* affected) Return the reference component given a potentially affected component. If affected appears in the AlignCmd's clipboard, then GetRe- ference returns the GraphicComp preceding it in the clipboard. If affected is the first component in the clipboard or if it is not on the clipboard, then GetReference returns the first component on the clipboard. ALIGNTOGRIDCMD PUBLIC OPERATIONS
AlignToGridCmd(ControlInfo*) AlignToGridCmd(Editor* = nil) Construct an AlignToGridCmd. virtual void Execute() virtual void Unexecute() AlignToGridCmd redefines Execute to let the selected GraphicView objects interpret the command the first time. This lets the compo- nents determine the proper grid with which to align themselves and the amount of movement required. Execute assumes that Graph- icView objects will use the Align operation (described below) to compute the amount of movement, store it in a MoveData object, and finally issue a MoveCmd to the subject for interpretation. Unexecute simply calls Unmove (described below) to reverse the Align's effects. virtual void Align(GraphicView*, float, float) virtual void Unalign(GraphicView*) GraphicView objects interpreting the AlignToGridCmd should use the Align operation to specify a point to align to the grid that affects them. Align will effectively move the component so that the given point falls on the grid. It will also store the amount of movement in this by calling Store with a MoveData object. Finally, Align calls Move (described below) to actually move the com- ponent that amount. Unalign provides a public interface to reversing the effects of Align by simply calling Unmove with its argu- ment's subject. ALIGNTOGRIDCMD PROTECTED OPERATIONS
void Move(GraphicComp*) void Unmove(GraphicComp*) Move produces a MoveCmd based on the MoveData stored for the given GraphicComp and tells the GraphicComp to interpret the MoveCmd. Conversely, Unmove produces a MoveCmd based on the the same information and tells the GraphicComp to uninterpret it. SEE ALSO
Command(3U), GraphicComp(3U), GraphicView(3U), Grid(3U), Viewer(3U), datas(3U), transforms(3U) Unidraw 23 January 1991 align(3U)
All times are GMT -4. The time now is 08:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy