10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am trying to search a list of strings from a file and display the string as well as the column in the search file it was found. I dont care about the row. what is wrong with my script?
while read line; do awk -v var="$line" '{for(i=1;i<NF;i++) if ($NF==$var) break; print $var FS $NF' }'... (3 Replies)
Discussion started by: senhia83
3 Replies
2. Shell Programming and Scripting
Hi All,
One of my source file is having more than 100 columns. Now, I need to check the particular string in 75th,76th and 79th columns of the source file.
If I find the particular string in above mentioned columns, then I need to print the entire record with line number.
Kindly help... (2 Replies)
Discussion started by: suresh_target
2 Replies
3. Shell Programming and Scripting
Hi Friends,
This is my input
chr1 100 200 + gene_name "alpha"; protein_name "alpha"; level 2; tag "basic"; info "known";
chr1 245 290 + gene_name "alpha-1"; protein_name "alpha-2"; level 9; tag "basic"; info "uknown";
chr1 310 320 + gene_name "alpha"; protein_name "alpha-4"; level 2; info... (3 Replies)
Discussion started by: jacobs.smith
3 Replies
4. Shell Programming and Scripting
I have 1000 different autosys jobs, want to extract only this information using unix commands.
Tried with normail greping but unable to make columns into rows.
Input:
/* ----------------- template ----------------- */
insert_job: template job_type: c
box_name: box1
command:... (3 Replies)
Discussion started by: onesuri
3 Replies
5. Shell Programming and Scripting
Hi,
my data is this way
abc def 01000000 kil
ghi 23 01000000 kim
ghj 0000 01000000 omg
now, I would like to replace 01000000 on the third column as 0.
I have a file with that value in different columns. So, any awk one liner that can let me change the column $ value would be highly... (4 Replies)
Discussion started by: jacobs.smith
4 Replies
6. UNIX for Dummies Questions & Answers
Hello all,
I have a .csv file with over 100 columns. I would like to grep for a pattern only searching within a range of those fields, and print the entire line. For example: grep a pattern from columns $47-$87, but print fields $0 - $100
Thanks! (9 Replies)
Discussion started by: torchij
9 Replies
7. Shell Programming and Scripting
Hi,
How can I grep a record for a value based on specific column.
If I simply do a grep 'AB' FilenName.txt, I might end up getting the records returned whose part of value is 'AB'.
But I want it specific to second column.
cut -d'|' -f 2 FileName.txt | grep 'AB'
But now it will return... (1 Reply)
Discussion started by: deepakwins
1 Replies
8. Shell Programming and Scripting
hello,
I have output from a command and I need to filter some info out of that. I tried awk command but I can not grep what I am looking for:
Following is the output and I need to capture "disabled" for each volume from first column and report:
# vol status
Volume State ... (2 Replies)
Discussion started by: za_7565
2 Replies
9. UNIX for Advanced & Expert Users
This is the data file that I have
21879, 0, 22, 58, 388
0, -1, 300, 1219172589765, 1708, 0, 200, 21891, 0, 0, 33, 309
0, -1, 300, 1219172591478, 1768, 0, 200, 22505, 0, 0, 33, 339
0, -1, 300, 1219172593251, 1738, 0, 200, 21888, 0, 1, 33, 308
0, -1, 300, 1219172594995, 633, 0, 200, 24878,... (2 Replies)
Discussion started by: pmallur
2 Replies
10. UNIX for Dummies Questions & Answers
I am given a file with a list of names for the first 20 characters. The 20 characters after is a list of names that somebody is supposed to team up with.
Now i'm trying to write a simple script that will read a name somebody inputs and then looks only in the first 20 characters.
For example.... (2 Replies)
Discussion started by: MaestroRage
2 Replies