tsv file comparison


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers tsv file comparison
# 1  
Old 03-25-2009
tsv file comparison

Hi Guys,

I have to write a script to compare the tsv files headers with the values stored in the variable in bash.

I have declared variables as
HEADER_VERSION="All Versions\tVersion Type\tVersion\tLevel"

now file contains data as follows:
Code:
All Versions    Version Type    Version Level
All Versions    Revisions       Version 1       Version
All Versions    Revisions       Version 2       Version
All Versions    Revisions       Version 3       Version
All Versions    Revisions       Version 4       Version
All Versions    Revisions       Version 5       Version
All Versions    Revisions       Version 6       Version
All Versions    Revisions       Version 7       Version
All Versions    Revisions       Version 8       Version
All Versions    Revisions       Version 9       Version
All Versions    Revisions       Version 10      Version


the first line is the header of the file.

Now i wanted to compare first line of the file with the variable value. While comparing the value in the variable should be evaluated i.e \t and then compared. and in case the file containing a null column at the end it should ignore.


how can i solve the above problem.

Last edited by Yogesh Sawant; 03-25-2009 at 05:35 AM.. Reason: added code tags
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Split each column in TSV file to be new line?

My TSV looks like: Hello my name is John \t Hello world \t Have a good day! \t See you later! Is there a simple bash script that splits the tsv on tab to: Hello my name is John Hello world Have a good day! See you later! I'm really stuck, would appreciate any help! (5 Replies)
Discussion started by: pxalpine
5 Replies

2. UNIX for Dummies Questions & Answers

Help with changing header of tsv with 30 million lines

Hi My 30 million line file has a header chr start end strand ref_context repeat_masked s1_smpl_context s1_c_count s1_ct_count s1_non_ct_count s1_m% s1_score s1_snp s1_indels s2_smpl_context s2_c_count s2_ct_count s2_non_ct_count s2_m% s2_score s2_snp s2_indels ... (2 Replies)
Discussion started by: plumb_r
2 Replies

3. Shell Programming and Scripting

File Comparison: Print Lines not present in another file

Hi, I have fileA.txt like this. B01B02 D0011718 B01B03 D0012540 B01B04 D0006145 B01B05 D0004815 B01B06 D0012069 B01B07 D0004064 B01B08 D0011988 B01B09 D0012071 B01B10 D0005596 B01B11 D0011351 B01B12 D0004814 B01C01 D0011804 I want to compare this against another file (fileB.txt)... (3 Replies)
Discussion started by: genehunter
3 Replies

4. Shell Programming and Scripting

Help with file comparison

Hello, I am trying to compare 2 files and get only the new lines as output. Note that new lines can be anywhere in the file and not necessarily at the bottom of the file. I have made the following progress so far. /home/aa>cat old.txt 0001 732 A 0002 732 C 0005 732 D... (7 Replies)
Discussion started by: cartrider
7 Replies

5. Shell Programming and Scripting

two file comparison

now i have a different file zoo.txt with content 123|zoo 234|natan 456|don and file rick.txt with contents 123|dog|pie|pep 123|tail|see|newt 456|som|sin|sim 234|pay|rat|cat i want to look for lines in file zoo.txt column1 that has same corresponding lines in column 1 of... (6 Replies)
Discussion started by: dealerso
6 Replies

6. Shell Programming and Scripting

awk with tsv & csv

Hi! HELP! I have a few issues... I have a tsv with headers time, binary time, bytes, and bits. I'm trying to extract only time & bits. (Trying to graph throughput) Using: awk -F"\t" '{print $1, "\t"$4}' infile.tsv > outfile.tsv Output is only the headers: time bits Thinking it... (2 Replies)
Discussion started by: calitiggr
2 Replies

7. Shell Programming and Scripting

pattern grep using Perl in .TSV file

Hi All, I have a .TSV extension file having ~1 Gig data and I need to grep a pattern in that file using perl. I am not able to read the file using perl any suggestions on this/ If I Change the format my data gets mismangled so I am bothered about using specific format as well. #!... (3 Replies)
Discussion started by: vmsenthil
3 Replies

8. Shell Programming and Scripting

4 column tsv file, output 1 specific column

Hello all siteexplorer.search.yahoo.com can output results in tsv format, when opened in excel I get 4 columns. I would like to wget that file, which I can do. I would then like to pull the 2nd column and output it only. I've searched around and found a few bits and pieces but nothing I've... (6 Replies)
Discussion started by: casphar
6 Replies

9. UNIX for Dummies Questions & Answers

Converting csv to tsv and back

Anyone have a simple UNIX script to look at for doing this? I'm interested in how to convert from csv to tsv, and then back again, if I want to. Thanks! (13 Replies)
Discussion started by: doubleminus
13 Replies

10. Shell Programming and Scripting

File Comparison

I have to compare two text files, very few of the lines in these files will have some difference in some column. The files size is in GB. Sample lines are as below: 11111122222222333333aaaaaaaaaabbbbbbbbbccccccccdddddd 11111122222222333333aaaaaaaaaabbbbbbbbbccccccccddeddd So assuming these... (19 Replies)
Discussion started by: net_shree
19 Replies
Login or Register to Ask a Question