Search Results

Search: Posts Made By: abk07
2,385
Posted By Ygor
Try...n1=$(head -1 file1) n2=$(tail -1 file1)
Try...n1=$(head -1 file1)
n2=$(tail -1 file1)
4,660
Posted By bartus11
Did you try my code posted above? I'll repost...
Did you try my code posted above? I'll repost it...awk '/\(\)/&&i==0;/{/{i++}/}/&&i--&&i==0' file
1,733
Posted By Franklin52
sed 's/\([^ ]*\) *\(.*\)/\1 \2/' file
sed 's/\([^ ]*\) *\(.*\)/\1 \2/' file
1,733
Posted By mirni
Although this smells like homework, here is your...
Although this smells like homework, here is your solution:
sed 's/\(\d*\) */\1 /'
1,733
Posted By birei
Hi, Try next 'Perl' instruction: $ perl...
Hi,

Try next 'Perl' instruction:

$ perl -lape 's/^(\d+)\s*(.*?)\s*$/$1 $2/' infile
Regards,
Birei
2,409
Posted By ctsgnb
I could not reproduce the problem on my machin......
I could not reproduce the problem on my machin...

# cat tst
1 a,b,c,d e,f,g,h,i
2 a,a,a a,b
3 a,b,c,d,a,b a,b
4 x,y p,q
5 a,b b,c
6 a,b,2 2,3# sed ':b...
2,409
Posted By ctsgnb
sed ':b s/\(,[^0-9]*\)[0-9]/\1,/g;t b' infileor ...
sed ':b s/\(,[^0-9]*\)[0-9]/\1,/g;t b' infileor
sed ':b s/\(,[^[:digit:]]*\)[[:digit:]]/\1,/g;t b' infile
Tested successfully on linux / GNU sed.

You may get a "label too long" error on Sun...
3,282
Posted By 116@434
Hey, it does not seem to be a problem exactly...
Hey, it does not seem to be a problem exactly with your code.

One possible fallout can be that your c<space>c is really a c<tab>c, but while on display it looks like one single space. A <tab>...
3,282
Posted By decent
I can't reproduce the problem either. Only spaces...
I can't reproduce the problem either. Only spaces are removed in my test file and it all works beautifully well.

So either it's a version that's different enough (GNU sed v4.2.1 here) or the...
Showing results 1 to 9 of 9

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