Sponsored Content
Full Discussion: modify one column
Top Forums Shell Programming and Scripting modify one column Post 302531407 by phil_heath on Thursday 16th of June 2011 05:06:42 PM
Old 06-16-2011
modify one column

Hi,

I have an output that looks unusual and it is very large so I cannot do it manually.

Basically it looks like this:


Code:
U	>c93[org=S_paradoxus][moltype=genomic][contig=c93]	57866	R
U	>c38[org=S_paradoxus][moltype=genomic][contig=c38]	66265	R
U	>c261[org=S_paradoxus][moltype=genomic][contig=c261]	80401	R
U	>c169[org=S_paradoxus][moltype=genomic][contig=c169]	12250	R
U	>c348[org=S_paradoxus][moltype=genomic][contig=c348]	2661	F
U	>c425[org=S_paradoxus][moltype=genomic][contig=c425]	38762	R
U	>c351[org=S_paradoxus][moltype=genomic][contig=c351]	44504	R
U	>c421[org=S_paradoxus][moltype=genomic][contig=c421]	8212	F
U	>c467[org=S_paradoxus][moltype=genomic][contig=c467]	3648	F
U	>c84[org=S_paradoxus][moltype=genomic][contig=c84]	33028	R
U	>c6[org=S_paradoxus][moltype=genomic][contig=c6]	4765	R

It is a tab separated file and I want it to modify the second column (basically simplify it) to look like this:

Code:
U	c93	57866	R
U	c38	66265	R
U	c261	80401	R
U	c169	12250	R
U	c348	2661	F
U	c425	38762	R
U	c351	44504	R
U	c421	8212	F
U	c467	3648	F
U	c84	33028	R
U	c6	4765	R

Thanks

Phil
 

10 More Discussions You Might Find Interesting

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

2. Shell Programming and Scripting

how can I modify this script.

hello forum members, I have a script which is used find the Uname and passwords and redirects into a output.txt file.I hardcoded a string "ciadev" but iwant search two more strings also "absdev" and "absprod" So modify this script please. I am lookinmg forward from you, please find the below... (2 Replies)
Discussion started by: rajkumar_g
2 Replies

3. Shell Programming and Scripting

Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2

Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2 file 1 sample SNDK 80004C101 AT XLNX 983919101 BB NETL 64118B100 BS AMD 007903107 CC KLAC 482480100 DC TER 880770102 KATS ATHR 04743P108 KATS... (7 Replies)
Discussion started by: rydz00
7 Replies

4. Shell Programming and Scripting

modify first column

Hi, I am use to using awk and sed. This time I have a file that has multiple columns. It looks like this: 4 6 7 8 5 4 3 2 3 2 6 9 I want to add chr to column 1 only so it looks like this: chr4 6 7 8 chr5 4 3 2 chr3 2 6 9 The file is tab seperated. Thanks ... (5 Replies)
Discussion started by: phil_heath
5 Replies

5. Shell Programming and Scripting

Rename a header column by adding another column entry to the header column name URGENT!!

Hi All, I have a file example.csv which looks like this GrpID,TargetID,Signal,Avg_Num CSCH74_1_1,2007,61,256 CSCH74_1_1,212007,647,679 CSCH74_1_1,12007,3,32 CSCH74_1_1,207,299,777 I want the output as GrpID,TragetID,Signal-CSCH74_1_1,Avg_Num CSCH74_1_1,2007,61,256... (4 Replies)
Discussion started by: Vavad
4 Replies

6. Shell Programming and Scripting

Difference of the same column when two other column matches and one column differs less than 1 hour

This is my input file : # cat list 20130430121600, cucm, location,76,2 20130430121600,cucm1,location1,76,4 20130430122000,cucm,location,80,8 20130430122000,cucm1,location1,90,8 20130430140000,cucm1,location1,87,11 20130430140000, cucm,location,67,9 This is the required output ... (1 Reply)
Discussion started by: Lakshmikumari
1 Replies

7. Shell Programming and Scripting

awk Print New Column For Every Two Lines and Match On Multiple Column Values to print another column

Hi, My input files is like this axis1 0 1 10 axis2 0 1 5 axis1 1 2 -4 axis2 2 3 -3 axis1 3 4 5 axis2 3 4 -1 axis1 4 5 -6 axis2 4 5 1 Now, these are my following tasks 1. Print a first column for every two rows that has the same value followed by a string. 2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies

8. UNIX for Dummies Questions & Answers

Modify Column Data using Shell Script

HI Guys, Input :- P081 wr1 12p0d5: 22.8 P081 wr1 12p2d18: 23.1 P149 wr1 1pxcud6/port_0_dev_7: 20.4 P149 wr1 1pxcud4/port_1_dev_10: 22.4 OutputP081 wr1 120 22.8 P081 wr1 122 23.1 P149 wr1 10 20.4 P149 wr1 11 22.4 In in First two line delete p and after d untill : In Last two line... (4 Replies)
Discussion started by: pareshkp
4 Replies

9. Shell Programming and Scripting

Ed to modify a file --- or not?

Running Oracle Linux 6 (derivative of RHEL 6) Given this snippet of code in a shell script: #-- reset oratab to use 11.2 home for dwdev #-- normally we'd just use sed to do this sort of thing, but that would #-- require permissions that we don't have in the /etc/ directory, so we #-- ... (3 Replies)
Discussion started by: edstevens
3 Replies

10. Shell Programming and Scripting

If pattern match in other column, modify column 3.

My command sed will modify everything in column 3 if i will use the command below. I want to search for a pattern then modify everything in column 3. sed -i 's/\|165\|/server1/g' file.txt Input: 01-31-2019 19:14:05|device|165|1548962040165|5c5348f9-0804-1111|file_attach|7271|587|smtp|... (6 Replies)
Discussion started by: invinzin21
6 Replies
SSAKE(1)						      General Commands Manual							  SSAKE(1)

NAME
ssake - assembling millions of very short DNA sequences SYNOPSIS
Progressive assembly of millions of short DNA sequences by k-mer search through a prefix tree and 3' extension. OPTIONS
-f Fasta file containing all the [paired (-p 1) / unpaired (-p 0)] reads (required) paired reads must now be separated by ":" -s Fasta file containing sequences to use as seeds exclusively (specify only if different from read set, optional) -m Minimum number of overlapping bases with the seed/contig during overhang consensus build up (default -m 16) -o Minimum number of reads needed to call a base during an extension (default -o 3) -r Minimum base ratio used to accept a overhang consensus base (default -r 0.7) -t Trim up to -t base(s) on the contig end when all possibilities have been exhausted for an extension (default -t 0)> -p Paired-end reads used? (-p 1=yes, -p 0=no, default -p 0) -v Runs in verbose mode (-v 1=yes, -v 0=no, default -v 0, optional) -b Base name for your output files (optional) ============ Options below only considered with -p 1 ============ -d Mean distance expected/observed between paired-end reads (default -d 200, optional) -e Error (%) allowed on mean distance e.g. -e 0.75 == distance +/- 75% (default -e 0.75, optional) -k Minimum number of links (read pairs) to compute scaffold (default -k 2, optional) -a Maximum link ratio between two best contig pairs *higher values lead to least accurate scaffolding* (default -a 0.70, optional) -z Minimum contig size to track paired-end reads (default -z 50, optional) -g Fasta file containing unpaired sequence reads (optional) SEE ALSO
/usr/share/doc/ssake/SSAKE.readme between AUTHORS
This manual page was written by Andreas Tille <tille@debian.org> for the Debian system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. January 2008 SSAKE(1)
All times are GMT -4. The time now is 07:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy