Sponsored Content
Top Forums Shell Programming and Scripting [Solved] Append an header to a tab delimited file Post 302733973 by paolo.kunder on Wednesday 21st of November 2012 10:39:41 AM
Old 11-21-2012
[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:

Code:
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
V$HAND1E47_01	3483	(-)	1	0.976	Hand1/E47
V$FOXD3_01	3869	(-)	1	0.966	FOXD3
V$FOXD3_01	3873	(-)	0.996	0.992	FOXD3
0610040J01Rik					
V$HNF1_C	273	(+)	0.942	0.855	HNF-1
V$OCT1_Q6	465	(+)	0.893	0.921	Oct-1
V$FOXD3_01	601	(+)	1	0.966	FOXD3
V$USF_Q6	1837	(+)	1	0.971	USF
V$COMP1_01	2435	(+)	0.786	0.817	COMP1
V$E2F_02	2779	(-)	1	1	E2F

and this is what I would like to obtain

Code:
0610009O20Rik						
V$VMYB_01	310	(+)	1	0.971	v-Myb	0610009O20Rik
V$EVI1_04	782	(-)	0.763	0.834	Evi-1	0610009O20Rik
V$ELK1_02	1966	(-)	1	0.984	Elk-1	0610009O20Rik
V$HAND1E47_01	3483	(-)	1	0.976	Hand1/E47	0610009O20Rik
V$FOXD3_01	3869	(-)	1	0.966	FOXD3	0610009O20Rik
V$FOXD3_01	3873	(-)	0.996	0.992	FOXD3	0610009O20Rik
0610040J01Rik						
V$HNF1_C	273	(+)	0.942	0.855	HNF-1	0610040J01Rik
V$OCT1_Q6	465	(+)	0.893	0.921	Oct-1	0610040J01Rik
V$FOXD3_01	601	(+)	1	0.966	FOXD3	0610040J01Rik
V$USF_Q6	1837	(+)	1	0.971	USF	0610040J01Rik
V$COMP1_01	2435	(+)	0.786	0.817	COMP1	0610040J01Rik
V$E2F_02	2779	(-)	1	1	E2F	0610040J01Rik
V$OCT1_Q6	2988	(+)	1	0.916	Oct-1	0610040J01Rik


any suggestion?
Thanks for your help,
Paolo

Last edited by paolo.kunder; 11-21-2012 at 11:47 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting Tab delimited file to Comma delimited file in Unix

Hi, Can anyone let me know on how to convert a Tab delimited file to Comma delimited file in Unix Thanks!! (22 Replies)
Discussion started by: charan81
22 Replies

2. UNIX for Dummies Questions & Answers

Delete header row and reformat from tab delimited to fixed width

Hello gurus, I have a file in a tab delimited format and a header row. I need a code to delete the header in the file, and convert the file to a fixed width format, with all the columns aligned. Below is a sample of the file:... (4 Replies)
Discussion started by: chumsky
4 Replies

3. Shell Programming and Scripting

Append output in tab delimited format

hello.. i m scripting in Perl and having issue writing the output in specific format..i read two files and run some commands and write output to one file. i want this to be a 2d table, File one has 48 rows and file two has 48 rows, first i take one id from file one, and go to second file, loop... (2 Replies)
Discussion started by: empyrean
2 Replies

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

5. Shell Programming and Scripting

Help with converting Pipe delimited file to Tab Delimited

I have a file which was pipe delimited, I need to make it tab delimited. I tried with sed but no use cat file | sed 's/|//t/g' The above command substituted "/t" not tab in the place of pipe. Sample file: abc|123|2012-01-30|2012-04-28|xyz have to convert to: abc 123... (6 Replies)
Discussion started by: karumudi7
6 Replies

6. Shell Programming and Scripting

How to make tab delimited file to space delimited?

Hi How to make tab delimited file to space delimited? in put file: ABC kgy jkh ghj ash kjl o/p file: ABC kgy jkh ghj ash kjl Use code tags, thanks. (1 Reply)
Discussion started by: jagdishrout
1 Replies

7. UNIX for Dummies Questions & Answers

How to add a header to a tab delimited .txt file?

Hi, I have a tab delimited document with 18 columns. My file looks like: comp1000201_c0_seq1 comp1000201_c0 337 183.51 0.00 0.00 0.00 0.00 ---NA--- 337 0 0 - comp1000297_c0_seq1 comp1000297_c0 612 458.50 ... (1 Reply)
Discussion started by: alisrpp
1 Replies

8. Shell Programming and Scripting

Insert a header record (tab delimited) in multiple files

Hi Forum. I'm struggling to find a solution for the following issue. I have multiple files a1.txt, a2.txt, a3.txt, etc. and I would like to insert a tab-delimited header record at the beginning of each of the files. This is my code so far but it's not working as expected. for i in... (2 Replies)
Discussion started by: pchang
2 Replies

9. UNIX for Dummies Questions & Answers

Need to convert a pipe delimited text file to tab delimited

Hi, I have a rquirement in unix as below . I have a text file with me seperated by | symbol and i need to generate a excel file through unix commands/script so that each value will go to each column. ex: Input Text file: 1|A|apple 2|B|bottle excel file to be generated as output as... (9 Replies)
Discussion started by: raja kakitapall
9 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
Locale::Language(3perl) 				 Perl Programmers Reference Guide				   Locale::Language(3perl)

NAME
Locale::Language - standard codes for language identification SYNOPSIS
use Locale::Language; $lang = code2language('en'); # $lang gets 'English' $code = language2code('French'); # $code gets 'fr' @codes = all_language_codes(); @names = all_language_names(); DESCRIPTION
The "Locale::Language" module provides access to standard codes used for identifying languages, such as those as defined in ISO 639. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default ISO 639 two- letter codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying languages. The ones currently supported are: alpha-2 This is the set of two-letter (lowercase) codes from ISO 639, such as 'he' for Hebrew. This code set is identified with the symbol "LOCALE_LANG_ALPHA_2". This is the default code set. alpha-3 This is the set of three-letter (lowercase) bibliographic codes from ISO 639, such as 'heb' for Hebrew. This code set is identified with the symbol "LOCALE_LANG_ALPHA_3". term This is the set of three-letter (lowercase) terminologic codes from ISO 639. This code set is identified with the symbol "LOCALE_LANG_TERM". ROUTINES
code2language ( CODE [,CODESET] ) language2code ( NAME [,CODESET] ) language_code2code ( CODE ,CODESET ,CODESET2 ) all_language_codes ( [CODESET] ) all_language_names ( [CODESET] ) Locale::Language::rename_language ( CODE ,NEW_NAME [,CODESET] ) Locale::Language::add_language ( CODE ,NAME [,CODESET] ) Locale::Language::delete_language ( CODE [,CODESET] ) Locale::Language::add_language_alias ( NAME ,NEW_NAME ) Locale::Language::delete_language_alias ( NAME ) Locale::Language::rename_language_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Language::add_language_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Language::delete_language_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes man page. SEE ALSO
Locale::Codes Locale::Constants http://www.loc.gov/standards/iso639-2/ Source of the ISO 639 codes. AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 1997-2001 Canon Research Centre Europe (CRE). Copyright (c) 2001-2010 Neil Bowers Copyright (c) 2010-2011 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2011-09-26 Locale::Language(3perl)
All times are GMT -4. The time now is 02:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy