Hi
i have file with data:
abc,*xyz,#abc
123,#123,1234
*123,#123,abc
So i want to remove only fields starting with * and # and i want output as:
abc,,
123,,1234
,,abc
Please suggest something
Thanks
Sumit
Hi
i have file with data:
abc,*xyz,#abc
123,#123,1234
*123,#123,abc
So i want to remove only fields starting with * and # and i want output as:
abc,,
123,,1234
,,abc
Please suggest something
Thanks
Sumit
next time, show what you tried.
awk -F"," '{
for(i=1;i<=NF;i++){
if($i ~ /\#|\*/){
$i=""
}
}
}1
' OFS="," file
i use dthe abov/e code but it is not working..
The entire row is getting blanks
so my output is 3 blank rows..
Pls suggest sumthing that can take care of this.
It works fine..
awk -F"," '{
> for(i=1;i<=NF;i++){
> if($i ~ /\#|\*/){
> $i=""
> }
> }
> }1
> ' OFS="," file1
abc,,
123,,1234
,,abc