Ask Your Question
1

How can I remove spaces from field names?

asked 2018-07-31 15:42:05 -0500

jeff gravatar image

Is there a good way to remove spaces from field names?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-07-31 16:40:47 -0500

jeff gravatar image

If you have only a limited number of possible spaces in all field names, you can get away with having a sequence of expressions in the field renamer processor like the following:

| Num spaces handled | Source Field Expression     | Target Field Expression |
| 1                  | /'([^ ]*) ([^ ]*)'          | /$1$2                   |
| 2                  | /'([^ ]*) ([^ ]*) ([^ ]*)'  | /$1$2$3                 |

You can extend this pattern to handle more and more numbers of possible spaces. If this becomes too unwieldy, you can use a scripting processor to rename fields in code, which can often be simpler. For an example of that, see this question and answer.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: 2018-07-31 15:42:05 -0500

Seen: 15 times

Last updated: Jul 31