scripting

excel vba- extract text between 2 characters

点点圈 提交于 2019-12-17 11:08:08
问题 If i had this column: ColA ----- NUMBER(8,3) NUMBER(20) I need a VBA function that would go (note these start and end string would only ever appear once in a cell): extract_val(cell,start_str,end_str) ie. extract_val(A1,"(",")") and give the results: 8,3 20 I only need to use this function within other vba code not by putting it as a formula on the sheet. UPDATE (thanks to the answer, i settled on:) --------------------------- Public Function extract_value(str As String) As String Dim openPos

Best tool(s) for decompiling Lua bytecode? [closed]

こ雲淡風輕ζ 提交于 2019-12-17 10:54:33
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I am really having trouble finding a good working Lua bytecode decompiler. I'm trying to decompile some scripting files I found in a

How to tell if a string is not defined in a Bash shell script

♀尐吖头ヾ 提交于 2019-12-17 10:07:46
问题 If I want to check for the null string I would do [ -z $mystr ] but what if I want to check whether the variable has been defined at all? Or is there no distinction in Bash scripting? 回答1: I think the answer you are after is implied (if not stated) by Vinko's answer, though it is not spelled out simply. To distinguish whether VAR is set but empty or not set, you can use: if [ -z "${VAR+xxx}" ]; then echo VAR is not set at all; fi if [ -z "$VAR" ] && [ "${VAR+xxx}" = "xxx" ]; then echo VAR is

Bash Script - iterating over output of find

帅比萌擦擦* 提交于 2019-12-17 09:59:42
问题 I have a bash script in which I need to iterate over each line of the ouput of the find command, but it appears that I am iterating over each Word (space delimited) from the find command. My script looks like this so far: folders=`find -maxdepth 1 -type d` for $i in $folders do echo $i done I would expect this to give output like: ./dir1 and foo ./dir2 and bar ./dir3 and baz But I am insted getting output like this: ./dir1 and foo ./dir2 and bar ./dir3 and baz What am I doing wrong here? 回答1:

how to get MouseMove and MouseClick in bash?

自闭症网瘾萝莉.ら 提交于 2019-12-17 09:31:48
问题 I'm wondering how to get the MouseClick and MouseMove events in bash scripting for my own simple OS events. Please tell me how to get that events. 回答1: The xterm terminal emulator defines some control sequences to do mouse tracking, you can learn more about them in the section Mouse Tracking in the document ctlseqs for the xterm distribution. If you have xterm installed, you'll probably have a copy at /usr/share/doc/xterm/ctlseqs.txt.gz or a similar path. Most terminal emulators running on

Store mysql query output into a shell variable

有些话、适合烂在心里 提交于 2019-12-17 09:19:08
问题 I need a variable to hold results retrieved from the database. So far this is basically what I'm trying with no success. myvariable=$(mysql database -u $user -p $password | SELECT A, B, C FROM table_a) My understanding of bash commands is not very good as you can see. 回答1: I don't know much about the MySQL command line interface, but assuming you only need help with the bashing, you should try to either swap the commands around like so: myvariable=$(echo "SELECT A, B, C FROM table_a" | mysql

How does the #! shebang work?

依然范特西╮ 提交于 2019-12-17 08:32:01
问题 In a script you must include a #! on the first line followed by the path to the program that will execute the script (e.g.: sh, perl). As far as I know, the # character denotes the start of a comment and that line is supposed to be ignored by the program executing the script. It would seem, that this first line is at some point read by something in order for the script to be executed by the proper program. Could somebody please shed more light on the workings of the #! ? I'm really curious

How does the #! shebang work?

China☆狼群 提交于 2019-12-17 08:31:03
问题 In a script you must include a #! on the first line followed by the path to the program that will execute the script (e.g.: sh, perl). As far as I know, the # character denotes the start of a comment and that line is supposed to be ignored by the program executing the script. It would seem, that this first line is at some point read by something in order for the script to be executed by the proper program. Could somebody please shed more light on the workings of the #! ? I'm really curious

How do I daemonize an arbitrary script in unix?

我的未来我决定 提交于 2019-12-17 08:04:08
问题 I'd like a daemonizer that can turn an arbitrary, generic script or command into a daemon. There are two common cases I'd like to deal with: I have a script that should run forever. If it ever dies (or on reboot), restart it. Don't let there ever be two copies running at once (detect if a copy is already running and don't launch it in that case). I have a simple script or command line command that I'd like to keep executing repeatedly forever (with a short pause between runs). Again, don't

How do I daemonize an arbitrary script in unix?

我们两清 提交于 2019-12-17 08:03:10
问题 I'd like a daemonizer that can turn an arbitrary, generic script or command into a daemon. There are two common cases I'd like to deal with: I have a script that should run forever. If it ever dies (or on reboot), restart it. Don't let there ever be two copies running at once (detect if a copy is already running and don't launch it in that case). I have a simple script or command line command that I'd like to keep executing repeatedly forever (with a short pause between runs). Again, don't