10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi All ,
I am having an input file as stated below
Input file
6 ddk/djhdj/djhdj/Q 10 0.5
dhd/jdjd.djd.nd/QB 01 0.5
hdhd/jd/jd/jdj/Q 10 0.5
512 hd/hdh/gdh/Q 01 0.5
jdjd/jd/ud/j/QB 10 0.5
HD/jsj/djd/Q 01 0.5
71 hdh/jjd/dj/jd/Q 10 0.5
... (5 Replies)
Discussion started by: kshitij
5 Replies
2. Shell Programming and Scripting
Hi,
I've data like these:
Gene1,Gene2 snp1
Gene3 snp2
Gene4 snp3
I'd like to split line if comma and then print remaining information for the respective gene.
My code:
awk '{
if($1 ~ /,/){
n = split($0, t, ",") (7 Replies)
Discussion started by: genome
7 Replies
3. Shell Programming and Scripting
I have the following script that will print column 4 ("25") when column 1 contains "123". However, I need to ignore the alpha characters that are contained in the input file. If I were to ignore the characters my output would be column 3.
What is the best way to print my column of interest... (3 Replies)
Discussion started by: ncwxpanther
3 Replies
4. Shell Programming and Scripting
I have an input file which is similar to what I have shown below.
Pattern : Data followed by two blank lines followed by data again followed by two blank lines followed by data again etc..
The first three lines after every blank line combination(2 blank lines between data) should be... (2 Replies)
Discussion started by: bikerboy
2 Replies
5. Shell Programming and Scripting
Hi,
I have a similar input format-
A_1 2
B_0 4
A_1 1
B_2 5
A_4 1
and looking to print in this output format with headers. can you suggest in awk?awk because i am doing some pattern matching from parent file to print column 1 of my input using awk already.Thanks!
letter number_of_letters... (5 Replies)
Discussion started by: prashob123
5 Replies
6. Shell Programming and Scripting
My scenario is that I need to pick value from third column based on fourth column value, if fourth column value is 1 then first value of third column.Third column (2|3|4|6|1) values are cancatenated.
Please someone help me to resolve this issue.
Source
column1 column2 column3 column4... (2 Replies)
Discussion started by: Ganesh L
2 Replies
7. Shell Programming and Scripting
Hello All,
I am here again scratching my head on pattern selection with special characters.
I have a large file having around 200 entries and i have to select a single line based on a pattern.
I am able to do that:
Code:
cat mytest.txt | awk -F: '/myregex/ { print $2}'
... (6 Replies)
Discussion started by: usha rao
6 Replies
8. Shell Programming and Scripting
Hello everybody,
I'm trying to count the number of consecutive lines in a text file which have two distinctive column field values. These lines may appear in several line blocks within the file, but I only want a single block to be counted.
This was my first approach to tackle the problem (I'm... (6 Replies)
Discussion started by: origamisven
6 Replies
9. Shell Programming and Scripting
Dear UNIX community,
I would like to to count characters from a specific row and have them displayed line-by-line.
I have a file called testAwk2.csv which contain the following data:
rabbit penguin goat
giraffe emu ostrich I would like to count in the middle row individually... (4 Replies)
Discussion started by: vnayak
4 Replies
10. Shell Programming and Scripting
Hi All,
I am another biologist attempting to parse a large txt file containing several million lines like:
tucosnp 56762 T Y 228 228 60 23 .CcCcc,,..c.c,cc,,.C...
What I need to do is get the frequency of periods (.) plus commas (,) in column 9, and populate this number into another... (1 Reply)
Discussion started by: peromhc
1 Replies