Search Results

Search: Posts Made By: sammy777
1,804
Posted By Corona688
$ awk '!(SEEN[$1,$4]++) && !(SEEN[$4,$1])' <<EOF ...
$ awk '!(SEEN[$1,$4]++) && !(SEEN[$4,$1])' <<EOF
dmn10003t1 PF00001 PF00022 dmn12390t1
dmn10008t1 PF00069 PF00027 dmn9781t1
dmn10008t1 PF00068 PF00027 dmn9781t1
dmn10008t1 PF00069 PF00069...
1,462
Posted By RudiC
How about awk ' {c++ ...
How about awk ' {c++
for (i=1; i<=NF; i++) if ($i ~ /prt1/) A[$i]
else B[$i]
for (i in A) for (j in...
4,885
Posted By RudiC
That space between block 2 and 3 hoses zaxxon's...
That space between block 2 and 3 hoses zaxxon's fine proposal... plus - I'm not sure what the FS is for.
4,885
Posted By zaxxon
$ awk '{print $0 > "cluster"NR".txt"}' FS="\n+"...
$ awk '{print $0 > "cluster"NR".txt"}' FS="\n+" RS= infile
3,615
Posted By alister
The OP did not specify an operating system, so...
The OP did not specify an operating system, so I'll mention that because of \n in the replacement text, that sed script will fail on most non-Linux systems.

Regards,
Alister

---------- Post...
3,615
Posted By Jotne
I do see now that the OPs output request also has...
I do see now that the OPs output request also has space in front
awk '{$1=" "$1}1' OFS="\n " ORS="\n\n"
This gives space in front of all line.
But we do not know for sure of is this he wants :)
3,615
Posted By Jotne
sed has same problem as perl it adds double...
sed has same problem as perl
it adds double blank line, since there is a space infront of the line
abc
qwe
tyu
ghj
jkl
dfg
sdf


cvb
sdk
fgh
tyu


uio
...
...
3,615
Posted By Just Ice
sed works too ... sed -e "s/$/\n/" -e "s/[...
sed works too ...
sed -e "s/$/\n/" -e "s/[ \n]/\n/g" infile
3,615
Posted By Jotne
awk '{$1=$1}1' OFS="\n" ORS="\n\n" infile This...
awk '{$1=$1}1' OFS="\n" ORS="\n\n" infile
This awk works if you have a space in front of some of the line or not
cvb vs cvb
@durden_tylor, you have removed this space in f02
perl gives an extra...
3,615
Posted By durden_tyler
$ $ cat f02 abc qwe tyu ghj jkl dfg sdf ...
$
$ cat f02
abc qwe tyu ghj jkl dfg sdf
cvb sdk fgh tyu
uio iop tyu rty eru wer rty iop
asd sdf dfg fgh zxc
$
$ perl -pne 'BEGIN {$\="\n"}s/ /\n/g' f02
abc
qwe
tyu
ghj
jkl
dfg
sdf
...
3,615
Posted By MadeInGermany
sed ' s/\( *[^ ]\{1,\}\)/\1\ /g ' infile
sed '
s/\( *[^ ]\{1,\}\)/\1\
/g
' infile
Showing results 1 to 11 of 11

 
All times are GMT -4. The time now is 05:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy