On 20.10.2012 05:00, roger vaede wrote:
> On Friday, October 19, 2012 5:31:01 PM UTC-4, roger vaede wrote:
>> I wanted to read a file and select the first 2 characters and if they are 9A or 7A
>>
>> I want to zero out columns 18 to 22 and 25 to 29.
>>
>>
>>
>> Can someone assist please. thanks
>
> Can you just leave the columns as they are.
Yes, that's what I've though to have done with my script, with one exception;
you complained that if your data is too short the zeroed fields will be left
aligned. I asked you what you want to be done in that case, but yet you
didn't tell us.
> if there are zeros just leave them
> if there are character leave them.
Yes, my script should not touch other columns as specified to be changed.
> I ran the second script still the zeros are not in the right columns.
This sentence doesn't help to see what you want and spot discrepancies.
Please provide complete data in your follow-up;
1. your sample input data
2. expected output data corresponding to the data in 1.
3. show us how you called the proposed script
4. show us the output of the script, so that we can compare it with 2.
5. and explain what shall happen if the data lines are shorter than 29 columns
so that we are able to see what the problem is.
Janis