Search Results

Search: Posts Made By: shelladdict
17,478
Posted By ctsgnb
Could you please copy paste all that you have as...
Could you please copy paste all that you have as input as well as result of the command ?

---------- Post updated at 01:34 PM ---------- Previous update was at 01:33 PM ----------

try the same...
2,825
Posted By bartus11
Try: perl -nae '@F[2..$#F]=sort...
Try: perl -nae '@F[2..$#F]=sort {$x=$a;$y=$b;$x=~s/[-+]//;$y=~s/[-+]//;$x cmp $y} @F[2..$#F];print "@F\n"' file
11,880
Posted By Klashxx
An infile replacement: # cat file 1 AB AC AD...
An infile replacement:
# cat file
1 AB AC AD EE
2 WE TR YT WW
3 AS UY RF YT
# perl -ni -e '($a,$b)=/^(\S+\s)(.*)/;$b=~s/\s//g;print $a.$b."\n";' file
# cat file ...
11,880
Posted By Franklin52
Another way: awk '{s=$1;gsub($1...
Another way:
awk '{s=$1;gsub($1 FS,x);$1=$1;print s FS $0}' OFS= file
1,091
Posted By ctsgnb
sed 's/ / c/g;s/cc//g' yourfileThis code works...
sed 's/ / c/g;s/cc//g' yourfileThis code works according to the given example, but if you have something like

56 cEFcH OccK LI

it will return

56 EFcH cOK cLI

Note that :
1. only the...
1,091
Posted By zaxxon
awk ' { for(x=1; x<=NF; x++){ ...
awk '
{
for(x=1; x<=NF; x++){
if($x !~ /c/ && x>1){
$x="c" $x
}
else{
sub(/c/,"",$x)
}
}
...
Showing results 1 to 6 of 6

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