cut

How to get uniq report with the below access log

北战南征 提交于 2019-12-02 09:29:46
问题 Input Severity: Warning Missing argument 1 for Pxxer_rzxczt_v3::mast() /sdfdsfv/ddw/hdd/nddd/system/adsdn/codsds/pr_rt_v3.php 115/dadm/index.php/plasdasd/mast/ Severity: Warning Missing argument 1 for Pxxer_rzxczt_v3::mast() /sdfdsfv/ddw/hdd/nddd/system/adsdn/codsds/pr_rt_v3.php 115/dadm/index.php/plasdasd/mast/ Severity: Warning Missing argument 1 for Pxxer_rzxczt_v3::mast() /sdfdsfv/ddw/hdd/nddd/system/adsdn/codsds/pr_rt_v3.php 115/dadm/index.php/plasdasd/mast/ Severity: Notice Undefined

Bash while loop + cut slow

淺唱寂寞╮ 提交于 2019-12-02 08:41:16
问题 I am trying to process a file (1.5GB) with a bash loop to iterate each line. I used cut for its simplicity (relative) and ended up with: while read line do echo "$(echo $line | cut -d' ' -f 2-3)" "$(echo $line | cut -d'"' -f 20)" done < TEST.log > IDS.log This is very slow and only does about 2KB/sec. I need something to run a lot faster. Also, what is the bottleneck here? 回答1: The bottleneck is likely that you spawn several processes for every line of data. As for a replacement, this awk

pass wildcard to cut command in shell script and store it in a variable

你说的曾经没有我的故事 提交于 2019-12-02 04:48:48
I am new to shell, I have a case where I am trying to evaluate a particular column unique values to check if they are valid in a shell script which will be invoked later. From my searches I think cut along with sort & unique is good to do it So my attempt is file=/filepath/*vendor.csv file_categories = `cut -d, -f1 $file |sort |unique` $file should hold file which has vendor in its filename but even after using command substitution (`) the $file is not getting replaced with the correct filename , it just places what is present in file Another example for what I am attempting is a=/stage

How to print columns one after the other in bash?

主宰稳场 提交于 2019-12-02 03:46:20
问题 Is there any better methods to print two or more columns into one column, for example input.file AAA 111 BBB 222 CCC 333 output: AAA BBB CCC 111 222 333 I can only think of: cut -f1 input.file >output.file;cut -f2 input.file >>output.file But it's not good if there are many columns, or when I want to pipe the output to other commands like sort . Any other suggestions? Thank you very much! 回答1: With awk awk '{if(maxc<NF)maxc=NF; for(i=1;i<=NF;i++){(a[i]!=""?a[i]=a[i]RS$i:a[i]=$i)} } END{ for(i

How to automatically remove the file extension in a file name

有些话、适合烂在心里 提交于 2019-12-02 03:36:54
问题 I am trying to make a script in bash that requires the removal of the the file extension from a file name, like the following original: something.zip removed version: something And I was thinking I could use cut for this, but I am worried that a situation could arise where there might be a file name that has more than one period, etc, something similar to the following something.v2.zip having said that, I was wondering if anyone had any recommendations as to what I could do to just remove the

How to get uniq report with the below access log

泄露秘密 提交于 2019-12-02 02:57:45
Input Severity: Warning Missing argument 1 for Pxxer_rzxczt_v3::mast() /sdfdsfv/ddw/hdd/nddd/system/adsdn/codsds/pr_rt_v3.php 115/dadm/index.php/plasdasd/mast/ Severity: Warning Missing argument 1 for Pxxer_rzxczt_v3::mast() /sdfdsfv/ddw/hdd/nddd/system/adsdn/codsds/pr_rt_v3.php 115/dadm/index.php/plasdasd/mast/ Severity: Warning Missing argument 1 for Pxxer_rzxczt_v3::mast() /sdfdsfv/ddw/hdd/nddd/system/adsdn/codsds/pr_rt_v3.php 115/dadm/index.php/plasdasd/mast/ Severity: Notice Undefined variable: vedwe erwer rew /sdfdsfv/ddw/hdd/nddd/system/adsdn/wefwf/efe/codsds/pr_rt_v3.php 130/dadm/index

How to automatically remove the file extension in a file name

余生长醉 提交于 2019-12-02 02:11:30
I am trying to make a script in bash that requires the removal of the the file extension from a file name, like the following original: something.zip removed version: something And I was thinking I could use cut for this, but I am worried that a situation could arise where there might be a file name that has more than one period, etc, something similar to the following something.v2.zip having said that, I was wondering if anyone had any recommendations as to what I could do to just remove the last period and the text after it from a line of text/filename? any help would be appreciated, thanks!

How to print columns one after the other in bash?

邮差的信 提交于 2019-12-02 01:47:18
Is there any better methods to print two or more columns into one column, for example input.file AAA 111 BBB 222 CCC 333 output: AAA BBB CCC 111 222 333 I can only think of: cut -f1 input.file >output.file;cut -f2 input.file >>output.file But it's not good if there are many columns, or when I want to pipe the output to other commands like sort . Any other suggestions? Thank you very much! With awk awk '{if(maxc<NF)maxc=NF; for(i=1;i<=NF;i++){(a[i]!=""?a[i]=a[i]RS$i:a[i]=$i)} } END{ for(i=1;i<=maxc;i++)print a[i] }' input.file You can use a GNU awk array of arrays to store all the data and

Use org.eclipse cut/copy/paste in custom RCP application

谁说我不能喝 提交于 2019-12-01 20:53:49
问题 I am developing a RCP application and I need cut/copy/paste in this app. As there are already commands which are delivered by eclipse (org.eclipse.ui.edit.copy, ...) I want to use them (I already added them to the toolbar, e.g.) in an editor. I played around a little, but I don't get it how I can react to the copy/paste command. E.g. how do I get informed in an editor if something was copied or pasted? Is there an easy way to use the commands like the Save Command. There I just have to

Get the value of a textbox during cut event

ぐ巨炮叔叔 提交于 2019-12-01 16:54:44
I have trapped the cut event (jquery) on a textbox. What I want is to get the text on the textbox during the cut event is triggered. I've tried accessing the data the user cut via evt.originalEvent.clipboardData.getData('text') but returns undefined. My goal is to know if the user cut all the text (textbox is now empty) or not. Thanks in advance You can setTimeout with a duration of 0, which schedules a function for immediate execution. The nice thing is that the function will execute once the text has already been cut, so you can check then if your textarea is empty (which would mean that the