we have multiple files eg B1234567 B1235468 etc. (numbers change daily, only constant is the B prefix)
trying to use using sed '/numberrange and length varies /d ' to remove a specific number range out of one of these files , we just don't know which one its in, as it could be in any one of them. We don't want to rename the filename, we want to keep the orginal filename that came in due to reconciliation processes.
I have no problems doing this online with the file but I want a script do it
apologies, I didn't explain that well. We get multiple B* files from the banks and the names of the actual B* file changes. However one of the B* files now references two accounts/groups in that file. We want to delete the content of the 2nd account of that original file without changing the name of the original file.
we are wanting to delete lines of texts from one of those B* files . but we cant always say its an exact line number. the /^999-999/d seems to work for deleting that whole line any other lines starting with that reference number.
if I run the following manually it looks ok from the unix prompt
for i in B*
do
sed '/^999-999/d'
done
it seems to work, but I don't know how to save it. I tried the $i after the delete as the name but the file didn't save the removed part.