10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am using awk to match columns and output based on those matches. For some reason it is not printing matching columns, am I missing something?
Operating system - windows with cygwin.
Command that I am using:
sed 's/]*,]*/,/g' $tempdir/file1 > $tempdir/file1.$$ && awk -F, 'FNR==NR{f2=$2... (7 Replies)
Discussion started by: dis0wned
7 Replies
2. Shell Programming and Scripting
I know I'm not the first one asking this but my code still does not work:
File 1: gi|1283| tRNAscan exon 87020 88058 . - . transcript_id "Parent=tRNA-Tyr5.r01";
gi|3283| tRNAscan exon 97020 97058 . + . transcript_id "Parent=tRNA-Tyr6.r01";
gi|4283| rRNAscan exon 197020 197058 . - . transcript_id... (5 Replies)
Discussion started by: 0sMoses
5 Replies
3. UNIX for Dummies Questions & Answers
Hi There,
I have an I/P which looks like --
1 2 3 4 5
1 2 3 4 6
4 7 8 9 9
5 6 7 8 9
I would like O/P to be ---
1 2 3 4 5
1 2 3 4 6
So, printing only the consecutive lines where $1,$2,$3,$4 are matching.
Is there any command to do this or small awk script?
Thanks, (12 Replies)
Discussion started by: Indra2011
12 Replies
4. Shell Programming and Scripting
I'm looking to remove duplicate rows from a CSV file with a twist.
The first row is a header.
There are 31 columns. I want to remove duplicates when the first 29 rows are identical ignoring row 30 and 31 BUT the duplicate that is kept should have the shortest total character length in rows 30... (6 Replies)
Discussion started by: Michael Stora
6 Replies
5. Shell Programming and Scripting
Hi all,
From a while loop I am reading a sorted file where I want to print only the lines that have $1 match and $2 only when the difference from $2 from the previous line is > 30.
Input would be like ...
AN237 010 193019 0502 1 CSU Amoxycillin
AN237 080 ... (2 Replies)
Discussion started by: gafoleyo73
2 Replies
6. Shell Programming and Scripting
Hi all,
on Solaris 10, I'd like to print a range of lines starting at pattern but also including the very first line before pattern.
the following doesn't print the range starting at pattern and going down to the end of file: cat <my file> | sed -n -e '/<pattern>{x;p;}/'
I need to include the... (1 Reply)
Discussion started by: siriche
1 Replies
7. Shell Programming and Scripting
Hi All,
I have two sets of files.
Set 1: 100 text files with extension .txt with names like 1.txt, 2.txt, 3.txt until 100.txt
Set 2: One big file with extension .dat
The text files have some records in columns like this:
0.7316431 82628
0.7248189 82577
0.7248182 81369
0.7222999... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies
8. Shell Programming and Scripting
Hi,
I wish to use a column, as inputted by a user from command line, for pattern matching.
awk file:
{
if($1 ~ /^8/)
{
print $0> "temp2.csv"
}
}
something like this, but i want '$1' to be any column as selected by the user from command line.
... (1 Reply)
Discussion started by: invinclible0009
1 Replies
9. Shell Programming and Scripting
I know this has been asked before but I just can't parse the syntax as explained. I have a set of files that has user information spread out over two lines that I wish to merge into one:
User1NameLast User1NameFirst User1Address
E-Mail:User1email
User2NameLast User2NameFirst User2Address... (11 Replies)
Discussion started by: walkerwheeler
11 Replies
10. UNIX for Dummies Questions & Answers
Hi ,
I have 5 columns total and am wanting to search lines in columns 3-5 and basically grep -v patterns that match 'BBB_0123' 'BVG_0895' 'BSD_0987'
Does anyone know how to do this? I tried combining grep -v with grep -e but, it didn't work.
Thanks! (5 Replies)
Discussion started by: greptastic
5 Replies