10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a csv dataset like this :
C,rs18768
G,rs13785
GA,rs1065
G,rs1801279
T,rs9274407
A,rs730012
I'm thinking of use like awk, sed to covert the dataset to this format: (if it's two character, then keep the same)
CC,rs18768
GG,rs13785
GA,rs1065
GG,rs1801279
TT,rs9274407... (7 Replies)
Discussion started by: nengcheng
7 Replies
2. Shell Programming and Scripting
Hello,
I have one script which looks as given below ,
. ${0%/*}/init && init_job || exit 1
what I understood is ,
1. above syntax has three commands, two on left of || and one on right of ||.
2. ${0%/*} would generate some path.
Question.
A. What is the meaning of ${0%/*} ,... (2 Replies)
Discussion started by: ParthThakkar
2 Replies
3. Shell Programming and Scripting
Hi Folks,
I had a requirement to replace a pattern a.*a with 'a' alone. I'm writing a sed command to do that. But I'm not able to work this out. Pls help me.
echo 'a123a456a789' | sed 's/a.*a/a/'
Expected o/p : a456a789
But actual o/p is a789. :confused:
how can write that... (6 Replies)
Discussion started by: poova
6 Replies
4. Shell Programming and Scripting
Hello,
I apologize for asking what is probably a simple question but I have been unable to understand the other posts on the topic. I have a file that has the following several lines:
ABC DEF GH:IJKLMNOP_QRS_TUV_11112012_ABCL5
ABC DEF GH:IJKLMNOP_QRS_TUV_11112013_ABCL4
ABC DEF... (4 Replies)
Discussion started by: MolecularToast
4 Replies
5. UNIX Desktop Questions & Answers
Hi,
I am trying to convert multiple Unix pipe symbol or bar into single |. I have tried with the following sed statements, but, no success :(. I need it using sed only
echo "sed 's/\|\+/\|/g'
sed 's/*/\|/'
sed 's/\|*/|/'
sed -r 's/\|+/\|/'
However, the below awk code is working fine.... (4 Replies)
Discussion started by: royalibrahim
4 Replies
6. Shell Programming and Scripting
Hi all,
Greetings,
I have the following scenario, The contents of main file are like :
Unix|||||forum|||||||||||||||is||||||the||best
so||||||be|||||on||||||||||||||||||||||||||||||||||||||||||||it
And i need the output in the following form:
Unix=forum=is=the=best
so=be=on=it
... (3 Replies)
Discussion started by: dipanchandra
3 Replies
7. UNIX for Dummies Questions & Answers
hi,
I want to search all files in the current working direcotry and to print in comma (,) seperated output. But I have two patterns to search for.
Files will be in ABC20100508.DAT format.
Search should happen on the format (ABC????????.DAT) along with date(20100508).
I can do a
ls... (2 Replies)
Discussion started by: anandapani
2 Replies
8. UNIX for Advanced & Expert Users
1. Is . wildcard? , the documented wildcard are "*", "?", and ""
. seems mean everything, the follwing cmd will copy everything
cp -r /tmp/test1/. /tmp/test2/
However it doesn't work for rm, why?
$ ls -a
. .. .a .aa aa t2
$ rm -rf .
$ ls -a
. .. .a .aa ... (3 Replies)
Discussion started by: honglus
3 Replies
9. Shell Programming and Scripting
Hi,
I have a file 'imei_01.txt' having the following contents:
$ cat imei_01.txt
a123456
bbr22135
yet223
where I want to check whether the expression 'first single alphabet followed by 6 digits' is present in the file (here it is the first record 'a123456')
I am using the following... (5 Replies)
Discussion started by: royalibrahim
5 Replies
10. Shell Programming and Scripting
I need to perform the following substitutions and have been struggling to determine if or how I can do this with sed or perl.
I need to change the string foo(bar) to moo(bar,0) wherever this occurs in a file.
Is there a way to do this? I'm thinking there might be a wildcard of some sort that... (4 Replies)
Discussion started by: Mike@NZ
4 Replies