Sponsored Content
Top Forums Shell Programming and Scripting Moving first position in a file to the last position Post 302433067 by cola on Monday 28th of June 2010 10:43:54 AM
Old 06-28-2010
Quote:
Originally Posted by vgersh99
Code:
sed 's/\([^|][^|]*|\)\(.*\)/\2\1/' myFile

Please explain the regular expression.

Last edited by cola; 06-28-2010 at 11:53 AM..
This User Gave Thanks to cola For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to get the position of a file

hi ' $ ls -ltr total 72 -rwxr-xr-x 1 staff 89 Jan 5 2008 STG_FCT__TYPE.dat -rwxrwxrwx 1 staff 28 Jan 5 2008 STG_FCT_LINE_SUMMARY.dat -rwxrwxrwx 1 staff 377 Jan 5 2008 STG_FCT_dd.dat -rwxrwxrwx 1 staff 7328 Jan 5 2008 ... (3 Replies)
Discussion started by: ravi214u
3 Replies

2. Shell Programming and Scripting

how to find a position and print some string in the next and same position

I need a script for... how to find a position of column data and print some string in the next line and same position position should find based on *HEADER8* in text for ex: ord123 abs 123 987HEADER89 test234 ord124 abc 124 987HEADER88 test235 ... (1 Reply)
Discussion started by: naveenkcl
1 Replies

3. UNIX for Dummies Questions & Answers

find if a position is between a given start and end position

Hi, I am a newbie in unix programming so maybe this is a simple question. I would like to know how can I make a script that outputs only the values that are not between any given start and end positions Example file1: 2 30 40 80 82 100 file2: ID1 1 ID2 35 ID3 80 ID4 81 ID6... (9 Replies)
Discussion started by: fadista
9 Replies

4. Shell Programming and Scripting

Replacing a position in a file

Hi I'm trying to use awk in a file(test123.dat). My requirement is to to check for the 65th position, if the 65th position is a space then replace the 65th position by the number 9. This is the code that i used: awk '{substr($0,65,1) ~ / / }{sub(substr($0,65,1),"9")}{print}' test123.dat ... (7 Replies)
Discussion started by: angelarosh
7 Replies

5. Shell Programming and Scripting

ksh - moving cursor position

hi all, am trying to modify a ksh script to group server names together depending on the cluster they sit in. currently the script does a find . -name '*.pid' to find all running servers and prints out their pids and names. current output looks something like this : serverA ... (1 Reply)
Discussion started by: cesarNZ
1 Replies

6. Shell Programming and Scripting

Remove text from n position to n position sed/awk

I want to remove text from nth position to nth position couple of times in same line my line is "hello is there anyone can help me with this question" I need like this ello is there anyone can help me with question 'h' is removed and 'this' removed from the line. I want to do this... (5 Replies)
Discussion started by: elamurugu
5 Replies

7. Shell Programming and Scripting

Need command or script to print all lines from 2nd position to last but one position

hi guys, i want command or script to display the content of file from 2nd position to last but one position of a file abcdefghdasdasdsd 123,345,678,345,323 434,656,656,656,656 678,878,878,989,545 4565656667,65656 i want to display the same above file without first and... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies

8. Shell Programming and Scripting

Identify the First Column Position in Second Column and add the position value

Identify the First Column Position in Second Column and add the position value in 3rd column. Sample data: a|c b|d c|a d|b e|e f|g g|f |h |i Expected Output: a|c|1 b|d|2 c|a|3 d|b|4 (6 Replies)
Discussion started by: BrahmaNaiduA
6 Replies

9. Shell Programming and Scripting

Search for a string at a particular position and replace with blank based on position

Hi, I have a file with multiple lines(fixed width dat file). I want to search for '02' in the positions 45-46 and if available, in that lines, I need to replace value in position 359 with blank. As I am new to unix, I am not able to figure out how to do this. Can you please help me to achieve... (9 Replies)
Discussion started by: Pradhikshan
9 Replies

10. Shell Programming and Scripting

Inserting value at a particular position without changing the position of other characters

Hi All, I wanted a sed/awk command to add a value/character on a particular position without disturbing the position of other characters. I have file a.txt OL 10031 Day Black Midi Good Value P01 P07 OL 10031 Day Black Short Good Value P01 P07 I want to get the output as... (2 Replies)
Discussion started by: rahulsk
2 Replies
XMoveWindow()															     XMoveWindow()

Name
  XMoveWindow - move a window.

Synopsis
  XMoveWindow(display, w, x, y)
	Display *display;
	Window w;
	int x, y;

Arguments
  display  Specifies a connection to an X server; returned from XOpenDisplay().

  w	   Specifies the ID of the window to be moved.

  x	   Specify the new x and y coordinates of the upper-left pixel of the window's border (or of the window itself, if it has no border),
  y	   relative to the window's parent.

Description
  XMoveWindow() changes the position of the origin of the specified window relative to its parent.  XMoveWindow() does not change the mapping
  state, size, or stacking order of the window, nor does it raise the window.  Moving a mapped window will lose its contents if:

  o  Its background_pixmap attribute is ParentRelative.

  o  The window is obscured by nonchildren and no backing store exists.

  If the contents are lost, exposure events will be generated for the window and any mapped subwindows.  Moving a mapped window will generate
  exposure events on any formerly obscured windows.

  If the override_redirect attribute of the window is False (see Volume One,  Chapter 4,  Window  Attributes)  and  the  window  manager  has
  selected  SubstructureRedirectMask on the parent, then a ConfigureRequest event is sent to the window manager, and no further processing is
  performed.

  If a client has selected StructureNotifyMask on the window, then a ConfigureNotify event is generated after the move takes place,  and  the
  event  will  contain	the final position of the window.  This is only useful in the case of top-level windows, since the window manager may
  modify or disallow moves.

Errors
  BadWindow

See Also
  XCirculateSubwindows(),  XCirculateSubwindowsDown(),	XCirculateSubwindowsUp(),  XConfigureWindow(),	XLowerWindow(),  XMoveResizeWindow(),
  XQueryTree(), XRaiseWindow(), XReparentWindow(), XResizeWindow(), XRestackWindows().

Xlib - Window Manipulation													     XMoveWindow()
All times are GMT -4. The time now is 11:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy