Programming :: Script To Exclude Words From A Lists?

Jun 16, 2010

how to delete string inside the file addresses.txt. The string I want to delete on addresses.txt was on removed.txt. I have a file addresses.txt and it includes the ff format:

test@foo.com
true@fee.com
fee@tik.com
ew@kit.com
test@foo.com

[Code].....

View 5 Replies


ADVERTISEMENT

Programming :: C++ Programming With Simple RTAI Functions Outputing Words?

Apr 11, 2011

I need help as I am not proficient with Linux C++ Programming. There are two parts which I need to do in the coding provided below.

1. Produce the program so it can output the word "Hey there!" and wait two minute and print the word "See you later!".

2. Produce the program that will output the text "Cool" every 20 seconds by setting a periodic task.

Quote:
#include <linux/kernel.h>
#include <linux/module.h>
MODULE_LICENSE("GPL");
int init_module(void)
{
printk("Hey there!

[Code]...

View 3 Replies View Related

Programming :: Add Text Between Two Words?

Mar 3, 2011

For example if i have the following "OneThree" and i want to add the word "Two" between "one" and "three". To have "OneTwoThree" How can i do this?

View 2 Replies View Related

Programming :: Array Containing Words In C?

Sep 24, 2010

This array is supposed to contain 12 elements (names of the month) What I want to achieve is that depending on some user input (a number 1-12) a full name of one of the months will be displayed, eg.

Code:
scanf("%d", &month);
printf("The month is %c", months_names[month]);

View 6 Replies View Related

Programming :: Find Syntax Exclude Certain Extensions And Filter By Age

May 26, 2010

I'm trying to find all the files in a specified directory that do NOT end in .archived or .error and are older than 30 mins. Currently I have: Code: find /opt/edi/incoming -type f ! ( -name "*.archived" -name "*.error" ) -cmin 30 But I keep returning files that end in those extensions and I'm not sure if I'm using -cmin correcty? If there is a better way to do this (perl, etc) I'm open to options, this is for a nagios check.

View 2 Replies View Related

Programming :: How To List Contents Of Directory And Exclude Any Subdirectories

Aug 2, 2010

I'm having trouble figuring out how to list the contents of a directory and exclude any subdirectories.

View 5 Replies View Related

Programming :: Unable To Exclude Lines And Bad Filter Within AWK Script

Apr 29, 2010

Looking for some help to fix 2 problems I have in my script. (I�m using bash on cygwin)I have the following source file ($7 does not have data):

Code:

HEADER_1,HEADER_2,HEADER_3,HEADER_4,HEADER_5,HEADER_6,HEADER_7
pattern2,pattern7/Sub data1/Sub data2,pattern8,pattern9,pattern2,pattern2,
pattern3,pattern6/Sub data1/Sub data2,pattern7,pattern3,pattern5,pattern1,

[code]....

In line 5 of the script, that is " {$2 !~ /pattern4|pattern5|pattern6/ }" oriented to delete lines containing pattern4, pattern5 and pattern6 from column 2 it seems not to be working. If I see the output, the line highlighted in red, is present and should not appear, because this line does not contain nor HEADER nor pattern1 nor pattern2.

View 7 Replies View Related

Programming :: Php Can Recognize The Number Of Words?

Jun 16, 2010

User submits a ms word file, and the php can recognize the number of words? Is it only possible for ms win server?

View 1 Replies View Related

Programming :: Match Strings Inside 2 Lists?

Jul 8, 2011

I have that script that checks the nfs mount points:

Code:
#!/bin/ksh
#set -xv
test="DO_NOT_DELETE"
rc=0

[Code]....

I am no expert in loops and it took me all day to write that. I couldn't really tell how to match the string in $df_file and $fs_share, so I did a little workaround with a count.

View 9 Replies View Related

Programming :: Awk To Extract Phrase Between Two Words On A Line?

May 25, 2010

im trying to find a way to extract the phrase between the words Connection and is (ie the underlined words below). Can we use awk to do this? How? Is it the best command to use?

Code:

[06:25:00][i] Connection at Plant A is live
[06:25:00][i] Connection at Building_C is not live
[07:25:00][i] Connection at Terminal D is down

View 12 Replies View Related

Programming :: Display Every Line That Does Not Contain One Of Listed Words / Fix It?

Feb 17, 2010

I am trying to eliminate false lsof file records but it does not work code...

View 4 Replies View Related

Programming :: Association Lists Are Faster Than Hash Tables?

Jun 13, 2011

I'm writing an interpreter and it used simple association lists for mapping varaible names to their values. Here's the code:

Code:

#include "assoc_array.hpp"
#include <string.h>
using namespace LANG_NAMESPACE;

[code]....

I thought that I would replace it with a hash table to increase performance. Note that I decided to store linked lists in the buckets instead of the actual values, in case the hash function outputs the same index for multiple variable names:

Code:

#include "hash_table.hpp"
#include "assoc_array.hpp"
#include <string.h>

[code]....

It runs in about 0.333 seconds on my machine. Since I'm using git version control, I decided to bring back the old version that used association lists. To my amazement, it ran 3 times faster, completing in 0.116 seconds! Is my hash table implementaion really that bad, or is this a really poor benchmark (and real-world code actually will be faster using the hash table)?

View 7 Replies View Related

Programming :: Indexing Variables In Lists Using Shell Scripts?

May 27, 2010

I have a question concerning indexing over lists with unix shell scripts. I have very large text files (up to 20 Gb) with the data shown below:

80011412865610
43000216943210
4710510513101

[code]...

View 14 Replies View Related

Programming :: Sending Mail To Mailing-lists In Perl?

Jan 25, 2011

Im creating a perl script that will be sending out mail to mailing-lists, but im not getting it to work. Its no problem getting the script to send mail to regular mail addresses, but it doesnt seem to handle to send mail to mailing lists. Im using the Net::SMTP perl module.how to send mail from a perl script to a mailing list (and not just regular mail addresses) ?

View 2 Replies View Related

General :: Use Exclude Option In"rm" Command To Exclude Some Files/folders?

Feb 3, 2010

i have created on folder in my server to upload some regular states. I want that user can modify or upload already stored files. but, should not upload any unwanted files orfolders.for that i want to use "rm" command as auto scheduler (putting this in cron tab.so that all files will be removed except some required files / folders for which this upload facility is activated. users are using secure-shell for uploading data.

View 1 Replies View Related

Programming :: Awk - Calculate The Number Of Words Containing Letter E In A Textfile?

Oct 12, 2010

i need to calculate the number of words containing letter e in a textfile.

View 9 Replies View Related

Programming :: Script To Search Users Home Directories For Certain Words?

Feb 20, 2011

I am trying to create a bash script that will search all users home directories on a system for words like quit, steal, kill etc. Pretty sure I'm going to be using grep /home. The only thing is that obviously a word like 'kill' could have normal uses too like "I need to kill the process." How would I go about flagging a user with the word/phrase found, and the path while also omitting legitimate uses?

View 1 Replies View Related

Programming :: Gedit - Plugin To Make HTML Tags From Words?

May 15, 2011

I need some plugin for Gedit (or maybe other HTML-editor) which will make tags of words, like: I type "div", hit some hotkeys or anything else with keyboard and get "<div></div>". The same with all the words I type in. Do you guys know which piece of software can do such things?

View 2 Replies View Related

Programming :: Highlight Some Key Words As Tailing A Log File Using A Perl Script

Oct 21, 2010

I'm trying to highlight some key words as tailing a log file using a perl script; about my case: I want to search for a keyworrs just once and highligt all occurrence of them. I want just highlit the keywords but not the whole line but the problems are that perl just catches the first keyword in a line and skip checking for other occurrence. for example if a line like "Error: some exception happen, Unable to process" it just highlight the error and do not process the remain part of the line where it should hilight the word "exception" and "Unable"

2-How can I do some action if for exapmle at least 4 time "unable" message appear ( not just in one line but diffrent line)in below is how I use perl search and replace : Code: s/(?:(unable|exception|warning))/e[1;31$&.......

View 2 Replies View Related

Programming :: Tail The Message Log| Grep - Several Words - Play A Sound When It's Found

Jul 4, 2011

I'm trying to write a script that will either tail or watch /var/log/messages for the words

PHP Code:

signal Gone into alarm state

From this line below.

I would then like the script execute:

And have run at start up.

I'm stuck with grep-ping only one word

PHP Code:

View 14 Replies View Related

Programming :: Substitute Few Words + Change All The Lines Starting With A Specific Word + Put Blank?

Jan 17, 2009

I have an old-address-list file which is having around 1500 entries. I need to convert this addresses in to a specific format.

The old-address-list file>
# cat old-address-list-file
dn: CN=Muhammad Hadhi K.M,OU=IT Dept,OU=Example Company H.O,DC=example,DC=com
cn: Muhammad Hadhi K.M

[code]....

View 6 Replies View Related

Programming :: Use Regex In Perl Script To Detect Allowed Words From The File And Then Print Output To The Screen?

Oct 4, 2010

Its my first post in here so please be patient I am trying to use regex in perl script to detect allowed words from the file and then print output to the screen.

As an example : I have text file with orders and returns :

Item2-SKU-2-11.08.2010-online
Item3-SKU-3-11.09.2010-return
Item4-SKU-4-11.09.2010-store

My question: is it possible to make sure that i am ony outputing to the screen orders based on few conditions like Item,order form e.g. online.And is it possible to have multiple matches (Item2 only diplay if ordered online etc)

View 1 Replies View Related

Programming :: Variable String File Base - Output File Doest Not Exclude The Values In Grep -av

May 1, 2011

My script.

This is may script:

Code:

Problem: Output file doest not exclude the values in grep -av

View 3 Replies View Related

Programming :: 'nm' Lists All Symbols - Including Static Library Symbols?

Apr 5, 2010

By issuing the 'nm' command on shared library (internally using one static library), the functions exposed by static library is also being listed, Which allows to use internal functions which is of course not intended. I have one static library having A(), B() and C() functions. Creating one shared library which has function XYS() that is using A() and B() functions from Static library. While doing 'nm' on shared library, all the static library function are being listed.

Static Lib:

#include<stdio.h>
void A(char *msg)
{
printf("

[code]....

View 4 Replies View Related

Programming :: Bash File Comparing - Report How Many Matching Words My Main File ?

Jun 9, 2009

I have been messing with diff and grep for 2 days now without result

I am trying to match a file consisting of words to many separate other wordfiles in a specific directory. one by one.

What i want the script to do is to report how many matching words my main file has with every file in the directory, each in turn

setup:

Each of em are plain text files with 1 word per line

Output should be something like:

SCRIPT REPORT:

View 8 Replies View Related

General :: Socket Programming - Feed Some Words One By One To The Socket

Jul 6, 2010

i'm writing a simple program of client socket program. Here below is the code sample which i'm writing...

Code:
//tcp_client.c
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include<string.h>
#include<stdlib.h>
[Code].....

the above code works fine.if we copmile and run ./a.exe 192.xx.xx.xxx 1111 and press enter it works fine..everytime it asks "Please enter the message: " and if give that will be displayed in server. but my problem is i dont want to print everytime "Please enter the message: " i just want to feed some words one by one to the socket.

View 4 Replies View Related

Programming :: Readdir() Gives "." And ".." And Doesn't Exclude Some Folders?

Aug 12, 2009

I was trying to make an interactive directory menu.But in the directory where he has to read, there are a few directories that i don't want my menu to show and the "." and ".." still shows to...I just changed all my specific names so you can modify it easier...and here is my code..

Code:
#include <stdio.h>
#include <errno.h>

[code]....

View 12 Replies View Related

General :: How To Exclude Last Several Characters?

Aug 17, 2010

any tips from you guys on how to filter my awk output?I want to exclude last 5 characters using awk in my tcpdump result.I don't want to include ".443:" in my tcpdump using awk.

View 6 Replies View Related

General :: How To Exclude Sub Directories From ZIP CLI

Jul 22, 2010

I'm trying to create backup/archive my Ubuntu 10.04 system files (so I can restore it in case my system get corrupted). More specifically, I'm trying to zip the important files in my root directory not including my home directory (which includes my documents which I backup separately/more frequently) to an external hard drive attached via USB (called 'My Book').Since File Roller didn't give me quite the level of control I was looking for, I created a script that I could execute to backup and archive regularly.

View 1 Replies View Related

General :: Exclude NFS In Find

Jan 20, 2010

I want to search files excluding the NFS find / -mount -name 'filename' restricts the search only in the root disc partition,but the file can be in other partitions also.Is there any way to exclude the NFS only...

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved