Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Cut the two column from non delimited file Post 302756099 by Wan Fahmi on Tuesday 15th of January 2013 07:44:19 AM
Old 01-15-2013
Cut the two column from non delimited file

Hi, I have a question how to cut the column from non delimited file

This is my file

Code:
gene_id ENSG00000223972 transcript_id ENST00000456328 exon_number 1 gene_biotype pseudogene gene_name DDX11L1 transcript_name DDX11L1-002 tss_id TSS26614
gene_id ENSG00000223972 transcript_id ENST00000515242 exon_number 1 gene_biotype pseudogene gene_name DDX11L1 transcript_name DDX11L1-201 tss_id TSS165962
gene_id ENSG00000223972 transcript_id ENST00000518655 exon_number 1 gene_biotype pseudogene gene_name DDX11L1 transcript_name DDX11L1-202 tss_id TSS165964
gene_id ENSG00000223972 transcript_id ENST00000450305 exon_number 1 gene_biotype pseudogene gene_name DDX11L1 transcript_name DDX11L1-001 tss_id TSS72060
gene_id ENSG00000223972 transcript_id ENST00000450305 exon_number 2 gene_biotype pseudogene gene_name DDX11L1 transcript_name DDX11L1-001 tss_id TSS72060
gene_id ENSG00000223972 transcript_id ENST00000518655 exon_number 2 gene_biotype pseudogene gene_name DDX11L1 transcript_name DDX11L1-202 tss_id TSS165964

I want to cut only the 1st and 2nd column (gene_id, ENST#)

Thank you

Last edited by Scrutinizer; 01-15-2013 at 08:52 AM.. Reason: quote tags => code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

To cut entire column from a file and apend it to another file as another column

file1.txt : india pakistan bangladesh japan canada africa USA srilanka Nepal file2.txt Delhi Tokyo washington I have to cut the first column of file1.txt and apend it with file2.txt as another column like this Delhi india Tokyo japan washington USA ... (4 Replies)
Discussion started by: sakthifire
4 Replies

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

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

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

5. Shell Programming and Scripting

Moving a column across a delimited data file

Hi, I am trying to move a column from one position to another position in a delimited file. The positions are dynamic in nature and are available by environmental variables. Also the file can have n number of columns. Example: Initial Column Position=1 Final Column Position=3 Delimiter='|' ... (2 Replies)
Discussion started by: ayan153
2 Replies

6. Homework & Coursework Questions

how to show particular column from pipe delimited file

hi, I have pipe delimited flat file as below 1|ab|4.5|9| 2|ac|3|12| 3|ac|4.5|8| i want to show (display) only 3rd field between pipes. please help (1 Reply)
Discussion started by: vai15517
1 Replies

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

8. Shell Programming and Scripting

How to cut a pipe delimited file and paste it with another file to form a comma separated outputfile

Hello ppl I have a requirement to split (cut in unix) a file (A.txt) which is a pipe delimited file into A1.txt and A2.txt Now I have to join (paste in unix) this A2.txt with external file A3.txt to form output file A4.txt which should be CSV (comma separated file) so that third party can... (25 Replies)
Discussion started by: etldev
25 Replies

9. Shell Programming and Scripting

Replacing a column in a pipe delimited file

Hi, I have a pipe delimited file as below and I need to replace the 2nd column of each line with null values. 1|10/15/2011|fname1|lname1 2|10/15/2012|fname2|lname2 3|10/15/2013|fname3|lname3 Output file: 1||fname1|lname1 2||fname2|lname2 3||fname3|lname3 I tried this ... (2 Replies)
Discussion started by: member2014
2 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
tabs(1) 						      General Commands Manual							   tabs(1)

NAME
tabs - set tabs on a terminal SYNOPSIS
[tabspec] n] type] DESCRIPTION
sets the tab stops on the user's terminal according to the tab specification tabspec, after clearing any previous settings. The user's terminal must have remotely-settable hardware tabs. If you are using a non-HP terminal, you should keep in mind that behavior will vary for some tab settings. Four types of tab specification are accepted for tabspec: ``canned'', repetitive, arbitrary, and file. If no is given, the default value is i.e., UNIX ``standard'' tabs. The lowest column number is 1. Note that for tabs, column 1 always refers to the left-most column on a terminal, even one whose column markers begin at 0. Gives the name of one of a set of ``canned'' tabs. Recognized codes and their meanings are as follows: 1,10,16,36,72 Assembler, IBM S/370, first format 1,10,16,40,72 Assembler, IBM S/370, second format 1,8,12,16,20,55 COBOL, normal format 1,6,10,14,49 COBOL compact format (columns 1-6 omitted). Using this code, the first typed character corresponds to card column 7, one space gets you to column 8, and a tab reaches column 12. Files using this tab setup should have specify a format specification file as defined by below. The file should have the following format specification: 1,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,67 COBOL compact format (columns 1-6 omitted), with more tabs than This is the recommended format for COBOL. The appro- priate format specification is: 1,7,11,15,19,23 FORTRAN 1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61 PL/I 1,10,55 SNOBOL 1,12,20,44 UNIVAC 1100 Assembler In addition to these ``canned'' formats, three other types exist: A repetitive specification requests tabs at columns 1+n, 1+2xn, etc. Of particular importance is the value this represents the UNIX ``standard'' tab setting, and is the most likely tab setting to be found at a terminal. Another special case is the value implying no tabs at all. The arbitrary format permits the user to type any chosen set of numbers, separated by commas, in ascending order. Up to 40 numbers are allowed. If any number (except the first one) is preceded by a plus sign, it is taken as an increment to be added to the previous value. Thus, the tab lists 1,10,20,30 and 1,10,+10,+10 are considered identical. If the name of a file is given, reads the first line of the file, searching for a format specification. If it finds one there, it sets the tab stops according to it, otherwise it sets them as This type of specification can be used to ensure that a tabbed file is printed with correct tab settings, and is suitable for use with the command (see pr(1)): Any of the following can be used also; if a given option occurs more than once, the last value given takes effect: usually needs to know the type of terminal in order to set tabs and always needs to know the type to set margins. type is a name listed in term(5). If no option is supplied, searches for the value in the environment (see environ(5)). If is not defined in the environment, tries a sequence that will work for many terminals. The margin argument can be used for some terminals. It causes all tabs to be moved over n columns by making column n+1 the left margin. If is given without a value of n, the value assumed is 10. The normal (left-most) margin on most terminals is obtained by The margin for most terminals is reset only when the option is given explicitly. Tab and margin setting is performed via the standard output. EXTERNAL INFLUENCES
Environment Variables determines the interpretation of text within file as single- and/or multi-byte characters. determines the language in which messages are displayed. If or is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty variable. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of If any internationalization variable contains an invalid setting, behaves as if all internationalization variables are set to "C". See environ(5). International Code Set Support Single- and multi-byte character code sets are supported. DIAGNOSTICS
Arbitrary tabs are ordered incorrectly. A zero or missing increment found in an arbitrary specification. A ``canned'' code cannot be found. option was used and file cannot be opened. option was used and the specification in that file points to yet another file. Indirection of this form is not permitted. WARNINGS
There is no consistency among different terminals regarding ways of clearing tabs and setting the left margin. It is generally impossible to usefully change the left margin without also setting tabs. clears only 20 tabs (on terminals requiring a long sequence), but is willing to set 64. SEE ALSO
nroff(1), pr(1), tset(1), environ(5), term(5). STANDARDS CONFORMANCE
tabs(1)
All times are GMT -4. The time now is 11:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy