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
I need to check whether first character of variable is single quote.
I tried the below constructions but they are all not working (always return true)
if (test `echo "$REGEXP" |cut -c1` != "'"); then echo "TRUE"; fi
if (test `echo "$REGEXP" |cut -c1` != '\''); then echo "TRUE"; fi
if (test... (5 Replies)
Discussion started by: urello
5 Replies
3. Programming
Dear Mates,
I am trying to write a macro to replace with its arguments with singles quotes around each argument.
#define DECR(a,b,c,d,e) decr('a','b','c','d','e')
if the usage is
DECR(k,e,y,s,\0)
I want it to be replaced with the following
decr('k','e','y','s','\0')
However it... (2 Replies)
Discussion started by: tamil.pamaran
2 Replies
4. UNIX for Dummies Questions & Answers
Hi
I normally use backspace to delete a single on my local machine in cygwin. Now I am trying cygwin on a virtual machine and when I type 'backspace', instead of a single character being deleted, the entire word gets deleted.
How do I change the settings for it?
I read somewhere that I... (2 Replies)
Discussion started by: ladyAnne
2 Replies
5. Shell Programming and Scripting
Hi
Does anyone know how to set any character as the field separator with awk/nawk on a solaris 10 box. I have tried using /./ regex but this doesnt work either and im out of ideas.
thanks (7 Replies)
Discussion started by: chronics
7 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
Using UNIX tools, but not using GAWK (NAWK is OK), is there a more elegant way to achieve this:
sed '
s/_a/_A/1
s/_b/_B/1
s/_c/_C/1
rest of alpahabet
'
I want to change the case of a single character in each string of a text file. The character will be matched by regex '_' and only... (2 Replies)
Discussion started by: uiop44
2 Replies
8. UNIX for Dummies Questions & Answers
Here is a sample code
grep '903' -i user.txt | tail -2 | awk '{print $2}' | sed 's/B//g'
the input file has data as such
903-xxx-xxxxB
903-xxx-xxxxB
It is a dialer file i want to remove the "B"
any help thanks (5 Replies)
Discussion started by: Iz3k34l
5 Replies
9. Shell Programming and Scripting
Could someone tell me the single character wildcard for SED?
I have the file below:
$ more input2
AAA /A/B/C BBB /D/E/F
CCC /G/H/I DDD
I want to remove all strings which contain forward slashs "/" to get the below:
AAA BBB
CCC
I tried to do it in SED by the command below but I... (8 Replies)
Discussion started by: stevefox
8 Replies
10. Programming
Can anyone help me?????
My problem is that i want to read only one charcter from keyboard. Each time my program waits to press enter or ^d. I don't want that. As soon as i press a charcter it should proceed to next statement in program without pressing enter or ^d.
please help... (3 Replies)
Discussion started by: alodha
3 Replies