Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Replace space in column with letter for several rows Post 302970628 by Egy on Saturday 9th of April 2016 09:24:43 AM
Old 04-09-2016
Replace space in column with letter for several rows

I have a pbd file, which has the following format:

Code:
TITLE     Protein X
MODEL        1
ATOM      1  N   PRO    24      45.220  71.410  43.810  1.00  0.00            
ATOM      2  H1  PRO    24      45.800  71.310  42.000  1.00  0.00            
TER
ENDMDL

Column 22 is the chain identifier for lines that begin with ATOM. I would like to replace the space in column 22 with the letter A. The actual file has thousands of rows labeled ATOM. An example output is given below:

Code:
TITLE     Protein X
MODEL        1
ATOM      1  N   PRO A  24      45.220  71.410  43.810  1.00  0.00            
ATOM      2  H1  PRO A  24      45.800  71.310  42.000  1.00  0.00            
TER
ENDMDL

Any help is much appreciated.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to add a space after an Upper case letter

Hi I have two questions. 1. how to convert "EverythingIsFine" to "Everything Is Fine" in a txt file. 2. how to convert everything to upper case letter and reverse, I hope there is a general purpose script for this. (1 Reply)
Discussion started by: onthetopo
1 Replies

2. UNIX for Dummies Questions & Answers

Extracting rows from a space delimited text file based on the values of a column

I have a space delimited text file. I want to extract rows where the third column has 0 as a value and write those rows into a new space delimited text file. How do I go about doing that? Thanks! (2 Replies)
Discussion started by: evelibertine
2 Replies

3. UNIX for Dummies Questions & Answers

merging rows into new file based on rows and first column

I have 2 files, file01= 7 columns, row unknown (but few) file02= 7 columns, row unknown (but many) now I want to create an output with the first field that is shared in both of them and then subtract the results from the rest of the fields and print there e.g. file 01 James|0|50|25|10|50|30... (1 Reply)
Discussion started by: A-V
1 Replies

4. Shell Programming and Scripting

Awk/sed - add space between dot and letter

I need to change . into . so that e.g. A.Jbecomes A. JI have tried sed 's/\./\.\ /g' but that didn't work. (9 Replies)
Discussion started by: locoroco
9 Replies

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

6. Shell Programming and Scripting

Program to match the id and replace one letter in the content

Hi all, I have one file with a sequence and the other file which says the position and the letter to be changed. I have to match two files and replace content. Example is shown which will describe what I want to do. For example, file 1 has many sequences and few are shown below sequence file:... (6 Replies)
Discussion started by: kaav06
6 Replies

7. Shell Programming and Scripting

Replace a character of specified column(s) of all rows in a file

Hi - I have a file "file1" of below format. Its a comma seperated file. Note that each string is enclosed in double quotes. "abc","-0.15","10,000.00","IJK" "xyz","1,000.01","1,000,000.50","OPR" I want the result as: "abc","-0.15","10000.00","IJK" "xyz","1,000.01","1000000.50","OPR" I... (8 Replies)
Discussion started by: njny
8 Replies

8. Shell Programming and Scripting

Replace rows to column

I have a csv file and i want to convert its rows into columns sample file like this Row1,1,2,3,......,n row2,4,5,6,.......,n . . . . rown,7,8,9,........,n i want it like this row1,row2,....,rown 1,4,.............,7 (4 Replies)
Discussion started by: sagar_1986
4 Replies

9. Shell Programming and Scripting

Replace specific letter in a file by other letter

Good afternoon all, I want to ask how to change some letter in my file with other letter in spesific line eg. data.txt 1 1 1 0 0 0 0 for example i want to change the 4th line with character 1. How could I do it by SED or AWK. I have tried to run this code but actually did not... (3 Replies)
Discussion started by: weslyarfan
3 Replies

10. Shell Programming and Scripting

Replace the first letter of each line by a capital

Hi, I need to replace, as the title says, the first letter of each line (when it's not a number) by the same letter, but capital. For instance : hello Who 123pass Would become : Hello Who 123pass Is there a way with sed to do that ? Or other unix command ? Thank you :) (7 Replies)
Discussion started by: ganon551
7 Replies
XSetWMProtocols(3X11)						     MIT X11R4						     XSetWMProtocols(3X11)

Name
       XSetWMProtocols, XGetWMProtocols - set or read a window's WM_PROTOCOLS property

Syntax
       Status XSetWMProtocols(display, w, protocols, count)
	  Display *display;
	  Window w;
	  Atom *protocols;
	  int count;

       Status XGetWMProtocols(display, w, protocols_return, count_return)
	  Display *display;
	  Window w;
	  Atom **protocols_return;
	  int *count_return;

Arguments
       display	 Specifies the connection to the X server.

       count	 Specifies the number of protocols in the list.

       count_return
		 Returns the number of protocols in the list.

       protocols Specifies the list of protocols.

       protocols_return
		 Returns the list of protocols.

Description
       The function replaces the WM_PROTOCOLS property on the specified window with the list of atoms specified by the protocols argument.  If the
       property does not already exist, sets the WM_PROTOCOLS property on the specified window to the list of atoms specified by the protocols
       argument.  The property is stored with a type of ATOM and a format of 32.  If it cannot intern the WM_PROTOCOLS atom, returns a zero sta-
       tus.  Otherwise, it returns a non-zero status.

       can generate and errors.

       The function returns the list of atoms stored in the WM_PROTOCOLS property on the specified window.  These atoms describe window manager
       protocols in which the owner of this window is willing to participate.  If the property exists, is of type ATOM, is of format 32, and the
       atom WM_PROTOCOLS can be interned, sets the protocols_return argument to a list of atoms, sets the count_return argument to the number of
       elements in list, and returns a a non-zero status.  Otherwise, it sets neither of the return arguments and returns a zero status.  To
       release the list of atom, use

       can generate a error.

Properties
       WM_PROTOCOLS
		 List of atoms that identify the communications protocols between the client and window manager in which the client is willing to
		 participate.

Diagnostics
       The server failed to allocate the requested resource or server memory.

       A value for a Window argument does not name a defined Window.

See Also
       XAllocClassHint(3X11), XAllocIconSize(3X11), XAllocSizeHints(3X11), XAllocWMHints(3X11), XFree(3X11), XSetCommand(3X11), XSetTransient-
       ForHint(3X11), XSetTextProperty(3X11), XSetWMClientMachine(3X11), XSetWMColormapWindows(3X11), XSetWMIconName(3X11), XSetWMName(3X11),
       XSetWMProperties(3X11), XStringListToTextProperty(3X11)
       X Window System: The Complete Reference, Second Edition, Robert W. Scheifler and James Gettys

															     XSetWMProtocols(3X11)
All times are GMT -4. The time now is 02:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy