Sponsored Content
Top Forums UNIX for Dummies Questions & Answers add (append) a column in a tab delimited file Post 302592085 by balajesuri on Sunday 22nd of January 2012 07:01:58 PM
Old 01-22-2012
Code:
$ cat input
test1    test2    test3
11    22    33
22    23    66
99    24    44
12    25    34
11    23    67
$
$ sed '1s/$/\tnewCol/; 2,$s/$/\t*/' input
test1    test2    test3    newCol
11    22    33    *
22    23    66    *
99    24    44    *
12    25    34    *
11    23    67    *
$
$

This User Gave Thanks to balajesuri For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete first column in tab-delimited text-file

I have a large text-file with tab-delimited genetic data that looks like: KSC112 KSC234 0 0 1 1 A G C T I simply wan to delete the first column, but since the file has 600 000 columns, it is not possible with awk (seems to be limited at 32k columns). Does anyone have an idea how to do this? (2 Replies)
Discussion started by: andmal
2 Replies

2. Shell Programming and Scripting

How to append database column to a delimited file

Hi, I have the below flat filewith ~ as delimiter emp.no~dept.name I need to append corresponding emp.name column which will come from database based on emp.no in the flat file. I need the output as dept.name~emp.name Can anyone please help me in resolving this issue.. I tried the... (2 Replies)
Discussion started by: siri_886
2 Replies

3. UNIX for Dummies Questions & Answers

Add a new column to a tab delimited text file

I want to add a new column to a tab delimited text file. It will be the first column and it will just be 1's. How do I go about doing that? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies

4. Shell Programming and Scripting

Using sed on 1st column of tab delimited file

Hi all, I'm new to Unix and work primarily in bioinformatics. I am in need of a script which will allow me to replace "1" with "chr1" in only the first column of a file which looks like such: 1 10327 rs112750067 T C . PASS ASP;RSPOS=10327;... (4 Replies)
Discussion started by: Hkins552
4 Replies

5. Shell Programming and Scripting

Extract second column tab delimited file

I have a file which looks like this: 73450 articles and news developmental psychology 2006-03-30 16:22:40 1 http://www.usnews.com 73450 articles and news developmental psychology 2006-03-30 16:22:40 2 http://www.apa.org 73450 articles and news developmental psychology 2006-03-30... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

6. Shell Programming and Scripting

[Solved] Append an header to a tab delimited file

Dear All, I would like to find an automatic way to add a given code which belong to a class at the end of the column , for example this is my input file: 0610009O20Rik V$VMYB_01 310 (+) 1 0.971 v-Myb V$EVI1_04 782 (-) 0.763 0.834 Evi-1 V$ELK1_02 1966 (-) 1 0.984 Elk-1... (4 Replies)
Discussion started by: paolo.kunder
4 Replies

7. Shell Programming and Scripting

Convert a 3 column tab delimited file to a matrix

Hi all, I have a 3 columns input file like this: CPLX9PC-4943 CPLX9PC-4943 1 CPLX9PC-4943 CpxID123 0 CPLX9PC-4943 CpxID126 0 CPLX9PC-4943 CPLX9PC-5763 0.5 CPLX9PC-4943 CpxID13 0 CPLX9PC-4943 CPLX9PC-6163 0 CPLX9PC-4943 CPLX9PC-6164 0.04... (7 Replies)
Discussion started by: AshwaniSharma09
7 Replies

8. Shell Programming and Scripting

Delete an entire column from a tab delimited file

Hi, Can anyone please tell me about how we can delete an entire column from a tab delimited file? Mu input_file.txt looks like this: And I want the output as: I used the below code nawk -v d="1" 'BEGIN{FS=OFS="\t"}{$d=""}{print}' input_file.txtBut in the output, the first column is... (5 Replies)
Discussion started by: sampoorna
5 Replies

9. Shell Programming and Scripting

Append data to first column delimited file

Hi, I have a data like Input: 12||34|56|78 Output: XYZ|12||34|56|78 I tried like this , but it puts it on another line awk -F "|" ' BEGIN {"XYZ"} {print $0} 'file Any quick suggessitons in sed/awk ? am using HP-UX (3 Replies)
Discussion started by: selvankj
3 Replies

10. UNIX for Beginners Questions & Answers

Replace a column in tab delimited file with column in other tab delimited file,based on match

Hello Everyone.. I want to replace the retail col from FileI with cstp1 col from FileP if the strpno matches in both files FileP.txt ... (2 Replies)
Discussion started by: YogeshG
2 Replies
g3data    (1) 				      General Commands Manual						     g3data    (1)

NAME
g3data -- A tool for extracting data from graphs. SYNOPSIS
g3data [-max x y] [-scale factor] [-coords llx lly rux ruy] [-errors] [-lnx] [-lny] [filename(s) ...] DESCRIPTION
2001-01-01; g3data is a tool for extracting data from scanned graphs. For graphs published in scientific articles the actual data is usually not explicitly given ; g3data makes the process of extracting this data easy. OPTIONS
-max x y If picture is larger x-wise than x or y-wise than y, the picture is scaled down accordingly otherwise this parameter has no effect. -scale factor Scales the picture size by factor. This parameter nullifies effect of the -max parameter. -coords llx lly rux ruy Preset the coordinates of the left lower (ll) corner and the right upper (ru) corner. -errors Print out the error of the x value in column 3 and the error of y value in column 4 of the output. -lnx Use logarithmic scale for x coordinates. -lny Use logarithmic scale for y coordinates. filename(s) ... The filename(s) of the image(s) to open. Supported image formats: PNG, XPM, JPEG, TIFF, PNM, RAS, BMP and GIF. USAGE
g3data -scale 2 -errors test1.png g3data -scale 2 -lny -errors test2.png BUGS
None known. AUTHOR
Jonas Frantz jonas.frantz@welho.com g3data (1)
All times are GMT -4. The time now is 02:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy