Sponsored Content
Top Forums Shell Programming and Scripting Delete an entire column from a tab delimited file Post 302783285 by sampoorna on Wednesday 20th of March 2013 08:00:45 AM
Old 03-20-2013
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:

Quote:
Name Postcode Fund ISIN
ABC TN16 9BE Franklin UK Mid Cap Fund A Inc GBP GB00B3ZGH246
ABC BH15 2BX Templeton Global Bond A Mdis GBP H1 LU0316492692
And I want the output as:
Quote:
Postcode Fund ISIN
TN16 9BE Franklin UK Mid Cap Fund A Inc GBP GB00B3ZGH246
BH15 2BX Templeton Global Bond A Mdis GBP H1 LU0316492692
I used the below code
Code:
nawk -v d="1" 'BEGIN{FS=OFS="\t"}{$d=""}{print}' input_file.txt

But in the output, the first column is coming as NULL and then the remaining columns are printed.

Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete parts of a string of character in one given column of a tab delimited file

I would like to remove characters from column 7 so that from an input file looking like this: >HWI-EAS422_12:4:1:69:89 GGTTTAAATATTGCACAAAAGGTATAGAGCGT U0 1 0 0 ref_chr8.fa 6527777 F DD I get something like that in an output file: ... (13 Replies)
Discussion started by: matlavmac
13 Replies

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

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. UNIX for Dummies Questions & Answers

add (append) a column in a tab delimited file

I have a file having the following entries: test1 test2 test3 11 22 33 22 44 66 99 99 44 --- I want to add a column so that the above file becomes: test1 test2 test3 notest 11 22 33 * 22 44 66 * 99 99 44 * --- Thanks (6 Replies)
Discussion started by: mary271
6 Replies

7. Shell Programming and Scripting

Parse tab delimited file, check condition and delete row

I am fairly new to programming and trying to resolve this problem. I have the file like this. CHROM POS REF ALT 10_sample.bam 11_sample.bam 12_sample.bam 13_sample.bam 14_sample.bam 15_sample.bam 16_sample.bam tg93 77 T C T T T T T tg93 79 ... (4 Replies)
Discussion started by: empyrean
4 Replies

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

9. Shell Programming and Scripting

Delete and insert columns in a tab delimited file

Hi all , I have a file having 12 columns tab delimited . I need to read this file and remove the column 3 and column 4 and insert a word in column 3 as "AVIALABLE " Is there a way to do this . I am trying like below Thanks DJ cat $FILENAME|awk -F"\t" '{ print $1 "\t... (3 Replies)
Discussion started by: Hypesslearner
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
Finance::Quote::Tiaacref(3pm)				User Contributed Perl Documentation			     Finance::Quote::Tiaacref(3pm)

NAME
Finance::Quote::Tiaacref - Obtain quote from TIAA-CREF. SYNOPSIS
use Finance::Quote; $q = Finance::Quote->new; %stockinfo = $q->fetch("tiaacref","TIAAreal"); DESCRIPTION
This module obtains information about TIAA-CREF managed funds. The following symbols can be used: Stock: CREFstok Money Market: CREFmony Equity Index: CREFequi Inf-Linked Bond: CREFinfb Bond Market: CREFbond Social Choice: CREFsoci Global Equities: CREFglob Growth: CREFgrow TIAA Real Estate: TIAAreal PA Stock Index: TIAAsndx PA Select Stock: TLSIX PA Select Growth Equity: TLGEX PA Select Growth Income: TLGIX PA Select Int'l Equity: TLIEX PA Select Social Choice: TLSCX PA Select Large Cap Value: TLLCX PA Select Small Cap Equity: TLCEX PA Select Real Estate: TLREX TIAA-CREF Money Market: TIAXX TIAA-CREF Bond Plus: TIPBX TIAA-CREF High-Yield Bond: TCHYX TIAA-CREF Inflation-Linked Bond: TCILX TIAA-CREF Short-Term Bond: TCSTX TIAA-CREF Tax-Exempt Bond: TCTEX TIAA-CREF Real Estate Securities: TCREX TIAA-CREF Equity Index: TCEIX TIAA-CREF Growth Equity: TIGEX TIAA-CREF Growth & Income: TIGIX TIAA-CREF International Equity: TIINX TIAA-CREF Large-Cap Value: TCLCX TIAA-CREF Mid-Cap Growth: TCMGX TIAA-CREF Mid-Cap Value: TCMVX TIAA-CREF Small-Cap Equity: TCSEX TIAA-CREF Social Choice Equity: TCSCX TIAA-CREF Managed Allocation: TIMAX This module is loaded by default on a Finance::Quote object. It's also possible to load it explicitly by passing "Tiaacref" in to the argument argument list of Finance::Quote->new(). Information returned by this module is governed by TIAA-CREF's terms and conditions. LABELS RETURNED
The following labels may be returned by Finance::Quote::Tiaacref: symbol, exchange, name, date, nav, price. SEE ALSO
TIAA-CREF, http://www.tiaa-cref.org/ perl v5.14.2 2012-05-06 Finance::Quote::Tiaacref(3pm)
All times are GMT -4. The time now is 09:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy