Hi this might be a basic question for many, but it has however managed to eat a couple of hours of my time.
I have large data file as an output from running a script. The file contains around 15 columns and around 100,000 rows. I wish to search through the file and in columns 4,5,6,7 and 8 check for specific values( and strings ). I know I can cut the columns separately and view them or use forward search("/") in less command. The problem here is the second and third column will also contain the value (almost in every other line) I search for. I only need the values in columns 4,5,6,7 and 8 for result interpretation and also I need to view adjacent columns too. How can I accomplish this? I do not want to use any external languages such as R, python or perl, I am looking for solutions using command line commands.
i use the following command to view the file;
bzcat myfile.tsv.bz2 | column -t | less -S
Any inputs will be appreciated.
Example of how the data looks like; (It is biological data within specific intervals)
col1 strt end Sample1 Sample2 Sample3 Sample4 Sample5 p.val1 p.val2 . ID
ABC 1100 1200 2 2 2 2 3 NA 0.27403 PLD4
BCD 1200 1300 4 3 4 4 2 0.88831 0.37662 CYP46A1
CDE 1300 1400 2 1 4 2 1 0.77922 0.00519 CEBPE
DEF 1400 1500 6 4 4 4 4 0.88182 NA BRCA
EFG 1500 1600 2 6 8 10 3 0.00779 0.01558 BRCA
Say I want to view the file on whole and restrict my only to search columns 4,5,6,7 and 8. ~M
Until you edit your question to provide more info, is this what you want?:
The above was run against your posted sample input file:
Given your comment below, is this what you want: