All Questions
21 questions
4
votes
3
answers
220
views
Add columns from variable number of files to base file
I'm dealing with a series of bed files, which look like this:
chr1 100 110 0.5
chr1 150 175 0.2
chr1 200 300 1.5
With the columns being chromosome, start, end, score. I have multiple different files ...
2
votes
4
answers
2k
views
How to not display a column that has all NULL values in a file
I have a file that has let's say, 5 columns(obtained by redirecting the results of a Sybase select query). Each column is separated by a tab. I need to filter out the columns that have all NULLs. Any ...
1
vote
3
answers
361
views
I want to empty one column, but I want to keep the header name in unix
I am using below command to empty the column but I want to keep the header row, how can I do it in the same command?
awk -F "," '{$10="";}1' OFS="," InputFile.csv > test.csv
0
votes
1
answer
65
views
Merge two texts with comparison of the rows and select one text's rows if some columns are similar
I have two different files which some rows of the two data measures a same thing. I want to have a merged output such that the rows of File1 will be the output row where the rows measures same thing (...
2
votes
3
answers
6k
views
Comparing csv files to lookup column 1 then check values in column 2
OK, I will try and explain what I need to do as best as possible.
Basically I have two CSV files, as per the examples below:
File 1:
Column 1, Column 2
abc , 123
def , 234
adf , 567
File ...
-1
votes
2
answers
508
views
Read data in two columns and print values if it contains NULL or Whitspaces
How can I read data separated by space in two columns and print value from column-1 that may contains Null or empty value next to it in columns-2 into a file, otherwise perform action if it has values ...
3
votes
1
answer
344
views
Can I force column to emit whitespaces instead of tabs?
I'd like to tabularize a file with the column command:
$ column -c 60 file.txt
The output is nice on the screen, but unusable for my purposes because the items are seperated by tabs. for further ...
3
votes
3
answers
226
views
Read columns from file, then column into an exsisting csv file
Essentially, I have a csv file that contain multiple columns, called cols.csv
1,a,100
2,b,200
3,c,300
4,e,400
and I have a new csv file that has one column, called col.csv
f
g
h
i
I want to copy the ...
6
votes
3
answers
5k
views
Compare a file with a column of another file
I have a file File1 with data as
aaa
bbb
And another file File2 with data as:
2,aaa,234
w,bbb,589
4,ccc,675
I need to compare the File1 data with column2 data of File2 and print the matching into a ...
1
vote
3
answers
173
views
Random sampling and outputting the largest value
I have a fairly large data set ~500 million rows. The data set looks like below. Col 1 is float number, col 2 is mac id(device id)
1616.93,ac:22:0b:a6:22:c3
2872.32,c0:bd:d1:36:bb:49
3314.55,d4:0b:1a:...
3
votes
3
answers
2k
views
Specific column level substitution
If I have a file with columnar entries, is it possible to substitute specific entries from a specific columns only and save changes to the same file??
Example a file abc.txt:
SR|FRUITS|COLOR|
1|...
1
vote
3
answers
2k
views
Find records present in file 1 also in both file 2 and file 3
I have three files file1.txt, file2.txt, file3.txt and they are of same format.
I want to select records from file1.txt which are present in both file2.txt and file3.txt based on column 2 and column ...
4
votes
4
answers
3k
views
How do I extract the first integer from text string in a column of a tab-delimited file?
I work in Medical Genetics and often have delimited text files where in one column (ex. column 5) there is a text string with a "mutation" in our jargon:
c.2458C>T or
c.45_46delAA or
c....
13
votes
5
answers
5k
views
What command(s) will feed a tab-delimited text file and cut each line to 80 characters?
I've got multiple-line text files of (sometimes) tab-delimited data. I'd like to output the file so I can glance over it - so I'd like to only see the first 80 characters of each line (I designed the ...
1
vote
1
answer
583
views
Comparing value in same column and directing output to new column
I have my input file as
DPortal=ECCN RemoteFile=4004_130122 0256 A02 141111 0940 29343414 11 110005
DPortal=ECCN RemoteFile=4004_130122 0256 A02 141111 2336 29843714 11 110006
DPortal=ECCN ...