Search Results

Search: Posts Made By: janex
1,839
Posted By janex
Thanks pravin27 and michaelrozar17 very much. I...
Thanks pravin27 and michaelrozar17 very much.
I tried michaelrozar17's solution.
It can work for the string "LG 0 0 18 14 172.16.2.20 1 2 OK T OK T OK T".
However the number of the space used for...
1,839
Posted By janex
Hi pravin27, thank you very much. I tried...
Hi pravin27, thank you very much.

I tried and it doesn't still work.

So far, perl -nle command can work.

I have a question, if the source is a file, how to make the format with perl -nle?
1,839
Posted By janex
Thanks Pravin27 again. I tried the following...
Thanks Pravin27 again.
I tried the following sed, it strange that there is no change for the source. What's wrong with the expression?
sed 's/" \(\w+\s+\d+\s+\d+\)\(\s+\d+\).*/\1,\2/g'
...
1,839
Posted By janex
Thanks pravin27, Can it be implemented with...
Thanks pravin27,
Can it be implemented with sed?
1,839
Posted By janex
How to get the formatted string with reg?
Source is
" LG 0 0 18 14 172.16.2.20 1 2 OK T OK T OK T"

How to get the following format string with reg?
LG 0 0, 18

Thanks in advance.
1,980
Posted By janex
Thanks your reply. sed 's/[ ]/,/5' is to...
Thanks your reply.

sed 's/[ ]/,/5' is to replace the fifth space with comma.

the result is "PUT 810 712 0001 ILC,AK4 00 0 00 00" and not the expected one.
1,980
Posted By janex
How to use sed to replace space partial
source "PUT 810 712 0001 ILC AK4 00 0 00 00"
It needs to be changed to "PUT,810,712,0001,ILC,AK4 00 0 00 00"

Thanks in advance.
Showing results 1 to 7 of 7

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