10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have a csv which has lot of columns . I was looking for an awk script which would extract a column twice. for the first occurance the header and data needs to be intact but for the second occurance i want to replace the header name since it a duplicate and extract year value which is in ddmmyy... (10 Replies)
Discussion started by: Kunalcurious
10 Replies
2. Shell Programming and Scripting
Hi Friends,
I have looked around the forums and over online but couldn't figure out how to deal with this problem
input.txt
gene1,axis1/0/1,axis2/0/1
gene1,axis1/1/2,axis2/1/2
gene1,axis1/2/3,axis2/2/3
gene2,axis1/3/4,axis2/3/4
Match on first column and if first column is... (1 Reply)
Discussion started by: jacobs.smith
1 Replies
3. Shell Programming and Scripting
I have a question that I am at a loss to solve. I have 3 column tab-separated data, such as:
abs nmod+n+n-commitment-n 349.200023
abs nmod+n+n-a-commitment-n 333.306429
abs into+ns-j+vn-pass-rb-divide-v 295.57316
abs nmod+n+ns-commitment-n 182.085018
abs nmod+n+n-pledge-n ... (2 Replies)
Discussion started by: owwow14
2 Replies
4. Shell Programming and Scripting
hi all,
how can i use grep or awk to clean the following input data:
n<>the<>96427210 861521305 123257583
n<>obj<>79634223 861521305 79634223
n<>nmod<>68404733 861521305 68422718
where the desired results is to remove all non-numeric characters?:
96427210 861521305 123257583 ... (5 Replies)
Discussion started by: owwow14
5 Replies
5. Shell Programming and Scripting
Hi
cat test.txt
H|123|341|567|asfg
D|dfg|trtyy|errt
D|ert|frty|wer
Here I need to replace the third column value with 100 of the first record only and while printing I need to print the full file content also..I am expecting a result like this
H|123|100|567|asfg
D|dfg|trtyy|errt... (3 Replies)
Discussion started by: saj
3 Replies
6. Shell Programming and Scripting
hi Friends
need to compare columns in one file where the data looks like below
laptop,IBM
phone,samsung
car,rental
user1,laptop
user2,laptop
user3,phone
want to get output as
laptop,IBM
phone,samsung
car,rental
user1,IBM
user2,IBM
user3,samsung
need to seach $2 in array of $1 and... (4 Replies)
Discussion started by: arun1401
4 Replies
7. Shell Programming and Scripting
Hi,
I have two input files as
File1 :
ABC:client1:project1
XYZ:client2-aa:project2
DEF:client4:proj
File2 :
client1:W-170:xx
client2-aa:WT-04:yy
client4:L-005A:zz
Also, array of valid values can be hardcoded like
Output :
ABC:W:project1
XYZ:WT:project2 (1 Reply)
Discussion started by: aa2601
1 Replies
8. Shell Programming and Scripting
Hi All ,
Here is my req
I am extracting a column value and I want to change part of its value according to user input
Say the column I extracted is of 15 digits and I want to change the 11th to 14th position with user input 4 digit value
Example column value 111111111111111 user input... (8 Replies)
Discussion started by: Pratik4891
8 Replies
9. Shell Programming and Scripting
Hello
I have a document and in this document I have several occurrence of "VAR == xxxxxxx" and xxxxx can be anything. I don't know what it is. I want to replace the 'xxxxx's with something I know.
What I know however, is the line numbers of the VAR =='s in the file.
How can I replace... (1 Reply)
Discussion started by: alirezan
1 Replies
10. Shell Programming and Scripting
$ cat log.txt
Name Age Sex Lcation nfld alias xsd
CC 25 M XYZ asx KK Y
BB 21 F XAS awe SS N
SD 21 M AQW rty SD A
How can I replace the column with header "Lcation" with the column with header "alias" and delete the "alias" column?
so that the final output will become:
Name Age Sex... (10 Replies)
Discussion started by: jkl_jkl
10 Replies