Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace pattern in variable labels with replacement #52

Open
arthur-shaw opened this issue Aug 13, 2024 · 2 comments
Open

Replace pattern in variable labels with replacement #52

arthur-shaw opened this issue Aug 13, 2024 · 2 comments
Labels
variable 🔢 Variable label

Comments

@arthur-shaw
Copy link
Contributor

arthur-shaw commented Aug 13, 2024

Image a set of variable labels with an obvious flaw.

v6601p_60_04    double  %85.0g     TU3_4      Primary activity: from 04:45 to 04:60
v6602p_60_04    double  %10.0g     TU4_4a     Any simultaneous activities from 04:45 to 04:60?
v6603p_60_04    double  %85.0g     TU4_4b     Simultaneous activity: from 04:45 to 04:60
v6601p_60_05    double  %85.0g     TU3_4      Primary activity: from 05:45 to 05:60
v6602p_60_05    double  %10.0g     TU4_4a     Any simultaneous activities from 05:45 to 05:60?
v6603p_60_05    double  %85.0g     TU4_4b     Simultaneous activity: from 05:45 to 05:60
v6601p_60_06    double  %85.0g     TU3_4      Primary activity: from 06:45 to 06:60
v6602p_60_06    double  %10.0g     TU4_4a     Any simultaneous activities from 06:45 to 06:60?
v6603p_60_06    double  %85.0g     TU4_4b     Simultaneous activity: from 06:45 to 06:60
v6601p_60_07    double  %85.0g     TU3_4      Primary activity: from 07:45 to 07:60
v6602p_60_07    double  %10.0g     TU4_4a     Any simultaneous activities from 07:45 to 07:60?
v6603p_60_07    double  %85.0g     TU4_4b     Simultaneous activity: from 07:45 to 07:60

For each given hour, one wants to replace {hour}:60 with {hour+1}:00.

The implementation design pattern might follow that of lbl_list_matching_var_lbls

@arthur-shaw arthur-shaw added the variable 🔢 Variable label label Aug 13, 2024
@arthur-shaw
Copy link
Contributor Author

TODO: post and refine draft in Senegal project: 10-data-preparation/utils/lbl_replace_in_var_lbls.do

@arthur-shaw
Copy link
Contributor Author

Consider having a dryrun option that previews changes without making them

In that preview, consider having a format like this

{varname}
OLD: {old_lbl}
NEW: {old_lbl}

In doing so, see if there are any SMCL tags that can be used used to structure information visually (e.g., header tags, colors, etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
variable 🔢 Variable label
Projects
None yet
Development

No branches or pull requests

1 participant