You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have many files, whose park numbers MY_SIG_INFO were in the old K-nnnnn format.
Now they all are US-nnnnn format.
I could easily change the data part by using sed or some other tool. But the length part needs to be +1 like:
<MY_SIG_INFO:6>K-1234 to <MY_SIG_INFO:7>US-1234
Can that be done now. I suppose I could assume all the records in the adif file would have the same <MY_SIG_INFO>.
So basically, can edit --set change only PART of field, and adjust the length properly?
Jerry WF5W
The text was updated successfully, but these errors were encountered:
There isn't currently a way to do this purely within adif-multitool, but I'd like to think about how it could be expressed. A programmer's first instinct might be to do something sed-like, perhaps adifmt edit -replace 'my_sig_info=/^K-(\d+)/US-\1/'. Introducing user-supplied regular expressions is something that should be done with care (I intentionally haven't supported them yet), so I'd like to consider other ways to express this.
The simple proposal above also wouldn't be great if someone had a lot of DX POTA contacts and wanted update the park references for many countries at once; some kind of lookup table might be more useful here. (Though I suppose you could use sed to generate a really long adifmt edit command line.) Before enacting this, I'd like to try to think of other fields that someone would want to do this kind of replacement on to make sure the way the feature is expressed is general-purpose. If we don't add a general-purpose feature, I suppose it could be a special flag for adifmt fix that just knows the full mapping and applies it to POTA_REF, MY_POTA_REF, SIG_INFO, and MY_SIG_INFO.
One hack that might work for you, combining adif-multitool and sed:
adifmt cat -output adx my_log.adi | \
sed 's/<MY_SIG_INFO>K-/<MY_SIG_INFO>US-/'| \
adifmt save my_log_updated.adi
The ADX format gets you out of the field-length problem, and the XML tag name structure (one tag per line) is probably easier to work with than -output tsv and matching the right column.
Not sure, if this can be done already.
I have many files, whose park numbers MY_SIG_INFO were in the old K-nnnnn format.
Now they all are US-nnnnn format.
I could easily change the data part by using sed or some other tool. But the length part needs to be +1 like:
<MY_SIG_INFO:6>K-1234 to <MY_SIG_INFO:7>US-1234
Can that be done now. I suppose I could assume all the records in the adif file would have the same <MY_SIG_INFO>.
So basically, can edit --set change only PART of field, and adjust the length properly?
Jerry WF5W
The text was updated successfully, but these errors were encountered: