Programming :: Use AWK To Search For A Specific String Inside Html?
Jan 26, 2010
how to search for a specific string of text inside an html document. I then want to cut out that specific data that the field or string contains. I want to do a shellscript that makes this function automaticly.
For example:
#
#Here i want to find the field "town" inside the html/java and then cut #out the town name from it and paste that to an file.
#
#
[Code].....
View 8 Replies
ADVERTISEMENT
May 7, 2010
Is there any way i can find a file with specific word inside it.For example if i want to find a file which has some text written inside it.How would i form a command to search them?
View 5 Replies
View Related
Apr 18, 2010
So if I'm given a location of a file like:
How can I just take the type of the file at the end? I know I can use strrchr() for a period to get the pointer to the period just before file type. Is there a build in string function that will just take the rest of the string from a certain point on forward in the string? I know it wouldn't be much work to make it myself, but I figured I would find out if it already existed before doing it.
View 9 Replies
View Related
Jul 24, 2010
I need to search a bunch of files in a specific folder for a specific number and add all the numbers together to a total sum. I use Rsync everyday, everytime I run rsync i get a logfile (rsync output) witch contains the textstring "Total bytes sent: xxxxxx".
The "xxxxx" can vary in lenght. I need to extract the "xxxxxx" from each file and add the numbers together to a total size over a week or a month. Is this possible? And I wish to only use bash. One way of doing stuff at a time my friends .
View 5 Replies
View Related
Sep 18, 2010
For a search box on my site, I want a textbox, which will let the user input the term to be searched for, and next to it I want a drop down list that'll have, for example, "Fruit" and "Vegetables" as categories to be searched within. How do I do the HTML for this? (so that the arguments to my search.php script will be eg. "search.php?text=apples&type=fruit" ? )
View 3 Replies
View Related
Mar 9, 2010
Trying to write a small php program to send emails using a form. I have collected all the information in php variables and I can send the mails just fine. But I need some neat and clean formatting for the mail that is received and hence thought html tables would be nice. But all the html tags are received as plain text and not html though I have mentioned in headers content-type to be html. Any links? If anyone can put some light on it? I thought that html tags would just work fine without much issue. I have tried same with asp and it worked.
PS: I am no programmer. Just trying my hands out on some php.
Edit: I am using a php mailer class from php classes to send mails. I need some way to use an external smtp server for sending mails. I have seen pear but I do not want to use pear. It is not available on the server I am testing and it is not possible for me to install it. I do not have access to install pear and can not ask to install it.
View 7 Replies
View Related
Jul 15, 2011
What I want to do is from a file having block like
<event>
8 3 0.2685416E-02
2 -1 0
21 -1 0
[code]...
The first line after the "<event>" is its process-id, so I would like to have at the end a summary of how many "event" block I have for each type, ie how many
6 1 0.2685416E-02
or how many
7 2 0.2685416E-02
etc etc
I do not know in advance how many different-kind of block I will have, so it has to be a bit smart to scan the file, and make an new "summary" info for each unique type I was using something like
awk '/<event>/,/</event>/{if ($3 -eq 0.2685416E-02 ) { print $1" "$2" "$3}}' file > out
and then
grep -c "$1" "$2" "$3" but with no success since my awk commands prints all lines of each block
Suppose, that in advance I do know the $3, ie the 0.2685416E-02 which is a kind of weight
View 8 Replies
View Related
Mar 10, 2011
How can I search for a string (for example, a constant) in all the (.cpp) files in the current direcotire and subdiretories.
View 4 Replies
View Related
Mar 13, 2010
I need to search a string which is in the first line and print that column.
For e.g
Code:
$ top -bn1 | head -20 | awk '/PID/,/*/'
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 13737 admin 15 0 2476 936 680 R 2 0.0 0:00.01
[Code]....
View 6 Replies
View Related
May 13, 2009
I'm trying to write a script that will spider a particular webpage that shows the current inventory for their products. I need to figure out the optimal method of parsing the web page, and extracting the <td> line for the "qty" for "Product 2":
Code:
<table border="0" width="100%" cellspacing="1" cellpadding="3">
<tr>
<td align="left" style="background-color: #EAEAFF; border-bottom-style: solid; border-bottom-width: 1" nowrap width="20%" height="50">
<p align="left"><font face="Arial" size="2"><b> Evaluation
[code[.....
View 4 Replies
View Related
Jan 25, 2010
im tryin to make a tool in visual C++ which will take an input string through a text box,then it will compare tht string with a text file containing data and display the matched results in list box.
View 2 Replies
View Related
Aug 27, 2010
These must a be a question you received a lot, but I couldn't find a similar thread! It's a simple question.
I need to delete a specific string from a file. For example the specific numbers "3456" from a file. I've tried with the tr comand, using
Code:
tr -d '3456' file,
but it also deleted whichever ocurrence of 3,4,5,6 from my file. Should I use a regular expression?
View 7 Replies
View Related
Apr 8, 2009
I am web developer I have this command find . -exec grep "Improve your score" '{}' ; -print for searching through files . I found this command but now i would like to tweak it to gain more out of it.
View 2 Replies
View Related
Jun 8, 2010
I want to append a variable string to the end of a specific line. not like append the same string to each line. like in my file i have 4 columns, i want to add a string in 5th column in some fixed row.
View 4 Replies
View Related
Oct 22, 2010
copy string a to string b and change string b with toupper() and count the chars
View 3 Replies
View Related
Sep 17, 2009
Is there a firefox add-on to script HTML and/or Javascript directly inside firefox
View 1 Replies
View Related
Aug 8, 2009
The below snippet works fine until I use strict. Then it dies with the following error: uote:Can't use string ("html") as an ARRAY ref while "strict refs" in use at ./filetest3 line 18.I want to create @lists based on the $scalars in @type. However, "my @$ext = ()"; and push (@$ext, @files); do not play nice with strict. How do I get around this?Quote:
#!/usr/bin/perl -w
system clear;
use strict;
[code]...
View 9 Replies
View Related
Jun 15, 2010
My website is domaintoolscentral dot com, I want to use PHP inside of my HTML pages but I can't seem to figure it out. I know it has to do with the httpd.conf file or I think it does. I do not want to use a .htacess file.
View 14 Replies
View Related
Nov 28, 2010
How can I search for one 6 letter word throughout all of my Ubuntu files?
Sounds simple but I've not found what I'm looking for. The bottom line is that I am wanting to clean up a file association in mime. I would have had more success if I were searching for this under XP. I must be doing something wrong.
Since I trialled a commercial company's map product under Wine somewhere in my system is still their name. Any gpx file I choose to download and the company's name appears in properties. Ggx files are also associated with Wine whilst an untainted PC in the house just has "Browse" as an "open with" option.
First things first, how do I find and delete this commercial company's name totally from any part of my system? How do I find their name in one or more of my files?
View 9 Replies
View Related
May 9, 2011
I'm trying to search the string "Listen" in a few files (config files). I madefind /apps/apache* -exec grep -H Listen {} ;but the result list is very long. How i make a "grep -v" whith this command?
View 3 Replies
View Related
Sep 12, 2009
what is the best way (i.e standard way that is supported on all browsers and probably as well followed by web crawlers).... to include an html file either locally or externally in another ? Of course , i've done the research and i also know that there are server side includes (php , asp ...you name it) at the moment , i'm using this:
Quote:
<script type="text/javascript" src="path to file/include-file.js"> </script>
however, i've been warned that this method may not show up in some browsers as some tend to ignore this tag and that crawlers like your favorite search engine wouldn't bother reading this. so , what is the best and safest way to do the job? and btw , the reason why i've ousted SSI's from the start is because of among other things:
1) the fact that the included file is static html and because the text is included pretty much everywhere
2) hoping to reduce load time as the code (if successfully recognized) would hopefully be treated like any other embedded external file (e.x like an image) , therefore it would be cached without the need to downloaded it over and over again for each new page on the site.
View 1 Replies
View Related
Jul 4, 2010
I would like a command or a bash script that search all files in all sub, modified last 12 hours, in /var/logs and that contains "alfa" or "bravo". The output should be filename of the file or files that contains that.
View 3 Replies
View Related
May 3, 2011
I've been trying to understand pthread in C a little better. So I made a simple program that takes in a string from the command line and creates a thread to print the string. I've looked online and copied the basic concepts but there are something things I'm confused about. The programs works just fine, but I have questions. Here's what I have so far.
[Code]....
One thing I'd like to know is why the 3rd argument in the pthread_create function which is my SendMessage function needs to be typecasted to a void pointer and then send the address of the function. Also as for the 4th argument, I would see typecasting to void pointer in some of the pthread examples I saw online, but in my case I'm passing a char pointer, would this be correct? In which case would I ever want to pass a void pointer?
Do I need a pthread_exit(NULL) in my main and in the SendMessage function? If so, why? I added the sleep() function so that I could let the pthread_exit function in my SendMessage function execute first. I simply saw that the online examples on pthread had pthread_exit() in both locations.
View 6 Replies
View Related
Feb 21, 2011
I need a shell script which will search and remove a javascript from all htm, html and php file.
Code:
<script type="text/javascript"> if (navigator.cookieEnabled) {var user = getCookie("seostop");if (user !=1){winchristop();setCookie("seostop", "1", 7,
[code]....
View 14 Replies
View Related
Jan 19, 2010
I am searching for Class declaration on a site with hundreds of PHP files, how can I do this in the current folder and subfolders using GREP?
I tested cding to the folder and then something like
grep -r 'class MyClass' *.php
View 5 Replies
View Related
Oct 22, 2010
Is there hopefully a way to search for an exact string in Man Pages? I know if I want to search for anything containing -c I can just do this.
Code:
/-c
How would I search for "-c"? I want only "-c" to show up. So I tried this.
Code:
/"-c"
It took me literally and looked for the quotes also.
View 8 Replies
View Related
Jan 13, 2011
I have a mail.log file, of which I want to redirect only the search strings of the sender from=<example.sender@exampledomain.com> and the size size=4537 to a file.
In every case the sender string starts as from=<> and the size string starts as size=
What would be the grep command to redirect only the two search strings to a .txt file?
View 2 Replies
View Related
Oct 28, 2009
find out a command to search among all *.dat files in a certain path (including subdirectories) looking for the following text in them:
Code:
--------------------------------------------------------------------------------
Elements with small area
Element Adjusted nodes
--------- --------------
16294 NO
17889 NO
and getting the list of elements with small area printed in a file "ErrorEl.txt". The output should have this form:
"/path/01/A.dat
bad-el#01
bad-el#02
[code]....
I know already how to find out the dat files containg a certain string
Code:
c=/path/
grep -R --include="*.dat" "Elements with small area" $c | cut -d: -f1>> ErrorEl.txt
but I don't know then how to get the element numbers(16294 and 17889 in the example above)
View 11 Replies
View Related
Dec 1, 2010
How can I search "$" in vim, which is not the end of line but the real char '$'.
View 1 Replies
View Related
Sep 4, 2009
I've just started playing with virtualization and I started my first VM. I would like to know if it's possible for the host machine to mount the partitions of the VM when it's closed. Right now the VM uses /dev/vg0/vm1 and has 3 partitions on it. I tried mount /dev/vg0/vm1 ~/vm1 at first before I remembered that I'd need a way to mount a specific partition inside the logical volume, not the volume itself!
View 2 Replies
View Related