Search Results

Search: Posts Made By: msabhi
2,119
Posted By msabhi
perl -alnF"\t" -e...
perl -alnF"\t" -e 'if($#F==2){$F[3]=$F[2];$F[2]="NA";print "@F"} else {print "@F"}' input_file

Try this if its given that always third column value is missing and 4th column is third column.
2,119
Posted By msabhi
I got the below $ perl -alnF"\t" -e...
I got the below


$ perl -alnF"\t" -e 'for($i=0;$i<=$#F;$i++){ if(!$F[$i]){$F[$i]="NA";}} print "@F"' file4
ch:12 1 3 4
ch:13 3 3 4
ch:25 1 NA 8
ch:23 2 8 1


Input :

ch:12^I1^I3^I4$...
2,119
Posted By msabhi
perl -alnF"\t" -e 'for($i=0;$i<=$#F;$i++){...
perl -alnF"\t" -e 'for($i=0;$i<=$#F;$i++){ if(!$F[$i]){$F[$i]="NA";}} print "@F"' input_fiile
Showing results 1 to 3 of 3

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