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. UNIX for Beginners Questions & Answers
Hi,
Need a help to replace a word if a pattern is found between the delimiters preferably using SED or AWK.
below is the sample file that iam dealing with, need to match pattern 'application' if found replace the whole word between the delimiters and also print the lines that don't match.... (1 Reply)
Discussion started by: tech_frk
1 Replies
3. Shell Programming and Scripting
Friends,
I have more the thousand lines like this.
check.cloud1.port=342
check.cloud2.port=5456
check.cloud3.port-4564
But we need to transfer it to
_CHECK.CLOUD1.PORT_=342
_CHECK.CLOUD2.PORT_=5456
_CHECK.CLOUD3.PORT_=4564
Any one could pls help of this. Thanks in Advance
... (1 Reply)
Discussion started by: jothi basu
1 Replies
4. Shell Programming and Scripting
awk 'FNR<='${linenum}' && /'"${SEC1}"'/ && /'"${SEC2}"'/' | wc -l
how can i use awk to count the lines instead of wc? (1 Reply)
Discussion started by: SkySmart
1 Replies
5. UNIX for Dummies Questions & Answers
Hi !
my input looks like that:
--AAA-AAAAAAA---------AA-
AAA------AAAAAAAAAAAAAA
------A----AAAA-----A-------
Using awk, I would need to replace only the "-" located between the last letter and the end of the string by "~"
in order to get:
--AAA-AAAAAAA---------AA~... (7 Replies)
Discussion started by: beca123456
7 Replies
6. Shell Programming and Scripting
Hi,
I am trying to replace 4th and 5th column data with the below code
awk -F, '$1=="ABC"&&$2=="XYZ" {gsub(/ABC/, "TEST" ,$4,$5)}' infile.txt > 1.txt
if the first column data is ABC and second column data is XYZ then replace ABC to test in 4th and 5th column, the above code is replacing the... (1 Reply)
Discussion started by: shruthidwh
1 Replies
7. Shell Programming and Scripting
Hello!
I have the following lines in a file:
1|0|HEADER|
2|1|HEADER|
3|1|MAIN|
4|1|INFO|
5|1|INFO|
6|1|INFO|
7|2|INFO|
8|4|INFO|
9|55|FOOTER|
10|1|HEADER|
11|22|MAIN|
12|9|MAIN|
and I want to convert it into: (7 Replies)
Discussion started by: TasosARISFC
7 Replies
8. Shell Programming and Scripting
Hello,
I really would appreciate some help with a bash script for some string manipulation on an SQL dump:
I'd like to be able to rename "sites/WHATEVER/files" to "sites/SOMETHINGELSE/files" within the sql dump.
This is quite easy with sed:
sed -e... (1 Reply)
Discussion started by: otrotipo
1 Replies
9. Shell Programming and Scripting
Sed help
echo "(200 rows affected)" | sed -e '/\(//p' | sed -e '/\)//p' | awk '{print $1}'
I want output as "200"
Please help me correct (2 Replies)
Discussion started by: pinnacle
2 Replies
10. Shell Programming and Scripting
Hey guys:
Running Solaris 5.5.1 and trying to write an easy /bin/sh script. Here is what I am doing...
grep "Total" /workspace_4/local/reports/cust_calls_5ess.050510 | awk '{print $4 "\t" $7 $8 $9 $10 $11 $12 $13 $14}'
It renders the following results...
315268 ... (2 Replies)
Discussion started by: cdunavent
2 Replies