如何将文本行转换为变量? [英] How to convert text lines to variables?

查看:107
本文介绍了如何将文本行转换为变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查看此列表.我需要将每个变量都变成一个变量并将其设置为0.例如:

Check out this list. I need each one turned into a variable and set equal to 0. Example:

;1-Methyoxy-2-Propanol would be:
$OneMethoxyTwoPropanol = 0

;and 1,2-BUTADIENE would be:
$OneTwoButadiene = 0

将它们分配给一个变量不是问题,但是有1500个.

Assigning them to a variable wouldn't be a problem, but there are 1500 of them.

推荐答案

如果我必须做这项工作,我会这样做:

If i had to do this work i'll make it this way :

  • 我将更改每个单词的大小写:

将正则表达式更改为句子大小写

  • 进行"SearchAndReplace":

  • Make a "SearchAndReplace" :

1->一个

1 -> One

2->两个

...

{下划线}->''

{space}->''

{space} -> ''

...

  • 然后在类似SublimeText的软件中,在每行前面添加一个$,并在末尾添加一个= 0.在Ctrl+Shift+L

  • Then in a soft like SublimeText i'll add a $ in front of each line and a = 0 at the end. With the help of the Ctrl+Shift+L

    也许您可以使用正则表达式来帮助您解决"SearchAndReplace"问题.

    Maybe you could use a regex to help you in the "SearchAndReplace" thing.

    这篇关于如何将文本行转换为变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆