Programming :: Arrays In Awk - Take Some Data From A File - Ssh Log - And Print It To A Html Table

Feb 7, 2011

I have a problem with arrays in awk. What i want is to take some data from a file (ssh log) and print it to a html table. I have managed to print some stuff (user logged in and how many times they have logged in) What i want more is to take all the ip that each user logged in from and print it in a row next to the username and times (in the code i typed blabbla where i want the ip to be shown. How do you think i should approch that, multidimensional arrys maybe?

Code:

View 14 Replies


ADVERTISEMENT

Programming :: Parse HTML And Print Specific Table?

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

Programming :: Put All The HTML In A Print Statement?

Sep 14, 2010

I have a site which will have, for example, a login system where people have to enter their usernames and passwords, depending on which they'll be let in to the site. So, in code, I've got a line like:

if ($_POST['password'] == $password) {
then do whatever
}
else { print "Wrong password" ; )

My problem is, this "Wrong password" printing is just a solitary line, not keeping with the colours and style of the site, and it looks very bad. I want to ideally, output some HTML, which will have a picture, and print the "Wrong password" in the font and colours I desire. Do I have to put all the HTML in a print statement, and then deal with the nightmare of escaping all the quote marks in it with a ""? Or is there a cleaner method to the whole thing? Maybe something like this -

if ($_POST['password'] == $password) {
then do whatever
}

[code]....

View 4 Replies View Related

Programming :: Getting Table Data From Web Pages?

Jul 18, 2011

I am writing a program and I need to be able to grab data from web pages.The data I am looking for is on wiki pages with basic tables.A simple example would be like grabbing all of the episode data from a TV show of something similar.

View 5 Replies View Related

Programming :: Read Text File Using Arrays In C++?

Oct 19, 2010

a project using bluetooth to send data byte by byte to external devices buti'm not familiar using arrays to read file from another location before sending the data.If you could,do correct my codes.Here's my code,

void loop(){
char Msg[]={"Hello"};
char *start;

[code]...

View 2 Replies View Related

Programming :: HTML Form Data In PHP Without Postback?

Feb 9, 2010

Just trying some programming with PHP. I need to write javascript code that contains some PHP code. The page extension is .php. I need to get the values from the HTML form text boxes in PHP variables without the click of submit button. I know there are these $_REQUEST, $_POST and $_GET functions that can do this. But they need a server hit for that. I need to somehow do it without hitting the server or hitting the server from javascript.

View 14 Replies View Related

Programming :: Output Data To An Ascii Table?

Oct 18, 2010

I've got lines of data in the following format:
space1=number of times error has occured
space2=IP address
space3=Error

I've set this out nicely with printf and made it email me, the problem is - it's not entirely clear what each column/space is and the IP and occurances can sometimes seem confusing. Is there any (easy) way to output this into an ascii like table? There will always be 5 occurances, and the format will always be the same

View 1 Replies View Related

Programming :: Copying Data To Clipboard Using OSF/Motif, C++, And XRT Table?

Dec 23, 2010

I am working on an application in Motif and C++, which uses an XRT Table. With the XRT Table being an infrequently used product, it is hard to find good documentation on it, and one area in particular is sorely lacking... a good explanation on how to copy text from the table to the clipboard used by other X11 applications. I've come across an example application that demonstrates how to copy text to the clipboard, but I cannot seem to merge that knowledge with what I'm provided with the XRT Table API. Does anyone have any knowledge in using the XRT Table, and in particular, with copying selected fields within the table to the clipboard?

View 3 Replies View Related

Programming :: Redirect Out Data From Console To Application Like Html / Web Pages

May 14, 2010

How system call internals could be known ? I mean for example if i take the example of write system call of linux kernel, where i can find out the code of write() system call in the kernel source tree ? The problem is write() system call directly write on console.If we want to write the data on some web page then write() system call will not do that ? How to redirect out data from console to application like html/web page?

View 6 Replies View Related

Programming :: Perl: Compare CGI Input With Data From A MySQL Table?

Nov 19, 2008

I have this program:

#! /usr/bin/perl
use DBI ;
use strict ;

[code]....

and I get this error simply running the program from the command line: DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 at ./submit.cgi line 24.

is this the right syntax to use, both, for this line:

my (@param) = $cgi->param("firstname","lastname","type") ;

as well as this one:

$sth=$dbh->prepare ("SELECT firstname,lastname,type FROM dts WHERE firstname LIKE $param[0] AND lastname LIKE $param[1] and type LIKE $param[2]" );

or should there be quotes around the $param[0] or something? (also is it $param[0] or $param(0)?)

View 1 Replies View Related

Ubuntu :: Output Data From Text File Into A Table?

Apr 13, 2010

I'm having a slight dilemma on reading data from a text file and outputting it into a table then displaying it. Basically I'm writing a shell script that takes information from text files then outputs the data into a table with 4 headings. The extracting of the data is fine, but creating a table i'm having problems with. My code extracts the data outputs the string to another file which works fineThe text file looks like this

mr smith 1 purchase oct 2007
mrs smith 2 purchase nov 2006
i want it to look like this

[code]....

View 7 Replies View Related

General :: Read Data From Text File And Output Into A Table?

Apr 12, 2010

I'm having a slight dilemma on reading data from a text file and outputting it into a table then displaying it. Basically I'm writing a shell script that takes information from text files then outputs the data into a table with 4 headings.he extracting of the data is fine, but creating a table i'm having problems with. I think it is possible to do it using the awk function, but so far i'm having a lot of difficulties.

View 14 Replies View Related

Programming :: Print, Store Or Compare An S8 Data Type?

Feb 15, 2011

I'm working with Radiotap headers right now. I want to get the RSSI data. I came through a problem that I can't figure out right now.The value that I need to get is:

Code:
s8 IEEE80211_RADIOTAP_DBM_ANTSIGNAL
now, when I printf it:

[code]...

View 4 Replies View Related

Programming :: Converting A HTML File To A PNG File Through Python Script?

Jan 29, 2010

I have managed to create a HTML file inside python code,convert this to a PNG file through a Python script ?

EDIT: Details added: I have a python script which generates map-legends in the form of an html file. The legend generated have to be pasted on a map which is in a png format. A png format file can be pasted on another png format file easily. But because the legends generated are in a html format I cannot paste it on the map file !!

EDIT: Details added: I did Googling first but it resulted in various soft wares for above purpose which I don't want !!

View 12 Replies View Related

General :: Print Data To Laser Printer Using An Overlay Form And Save File As Pdf?

Jun 5, 2010

i have custom programs written in Basis pro5. Standard output to a pdf virtual printer works fine. Using pdftk to overlay on to a form is hit or miss.... There are products out there like Unform that are just too expensive for my company. i have purchased another product from a company that prints the forms to the laser perfectly but i am incapable of capturing them and saving them as pdf's for archiving/emailing/faxing and i don't much care for this company.

View 2 Replies View Related

Programming :: Getting Table Name From A Text File?

Mar 11, 2011

I have been working on this since 3 days but wasn't able to achieve what I want

I have a big text that has the following format:

Current max fieldLen for table1 (a):
Fld# Width MaxWidth ERR NAME
---- ------ -------------- ------ ---------
2: 80 38 *** field-name
3: 4 2 field-version
4: 40 7 field-value

[Code]....

View 7 Replies View Related

Programming :: Cutting An Html File Apart - Perl - Sed - Awk?

Apr 13, 2010

I have an html file like this

HTML Code:

Some more HTML code... I would like to cut the above text so i get this: Sometext on multiple lines like this.Sometext on multiple lines like this.Sometext on multiple lines like this. Sometext on multiple lines like this.Sometext on multiple lines like this.

There are other HTML files with similar cuts I need to do, but once I have the method for doing one, I am sure I can do the others.

I think the two logical strings to cut between would be:

I am not sure if these strings are always the start and end of the line respectively, is this makes a lot of difference! Then the HTML tags would need to be stripped to get the text on its own.

I know the commands for removing tags, but searching for a string like class="IOSSectionTitle", and cutting everything before it etc is something I am finding challenging.

Just thought I would add that the HTML does not nec. appear on logical new lines throughout the file and there may be unexpected new lines, but as far as i know the class="IOSSectionTitle" and <img always appears as a string without any new lines between those characters.

View 4 Replies View Related

Programming :: Add HTML Formatting To Text File?

Jun 30, 2010

I need to extract som text from a text file. The text is a test log with system info at the top and results further down. What I need is to add different tags with formatting before and after each line. I have prepared a template with html formatting, but the number of lines in the test log may be different from case to case, so I need to be able to add formatting tags by need. Can this be done using bash script, sed, awk, head, tail... ?

View 4 Replies View Related

Ubuntu Servers :: RAID Arrays Rebuild The Data On The New Drive?

Jun 5, 2010

I have never preformed a rebuild of an RAID array. I am collecting resources, which details how to build an RAID 5 array when one drive has failed. Does the BIOS on the RAID controller card start to rebuild the data on the new drive once it is installed?

View 4 Replies View Related

Programming :: Script To Create Index.html File?

Sep 25, 2010

I need a script that can do this: A script that searches all directories and subdirectories for .html files When a .html file is found it creates a index.html file in that folder. It then edits the index.html file and inserts links to all of the .html files that are in that folder into the body. If no .html files are found, it searches for folders. It then creates a index.html file with links to all of the folders.

View 4 Replies View Related

Programming :: Insert A Comment In Html File Based On Its Contents?

Jun 10, 2010

I have multiple HTML files in a folder. there is a <h2> tag like this:

Code:

<h2>some text</h2>

in each file. I want to write a shell script/batch file to add this tag in <head> section of each file:

Code:

<!-- TITLE= "same text from h2 tag" -->

Note that <h2>some text</h2> in some files has 1 or more linebreaks and so I couldn't capture tag content using a simple grep or...
for example:

<h2>first part of text
second line of text</h2>

The line break shouldn't be shown in <!-- TITLE= "same text from h2 tag" -->. The script has to capture tag content & skip line breaks.

View 3 Replies View Related

Programming :: Script To Create Simple HTML From Text File?

Oct 1, 2009

I am working on a script to convert a comma seperated text file into html code line by line. The text file is like so:

Code:

link url, image url, description and I want it to output this:

Code:

<td><a href=�link url�><img src="image url" alt=�description" /></a></td>

Here is what I have so far:

Code:

#!/bin/bash
var1='<td><a href=
var2='><img src="'
var3='" alt=�thumbnail image" /></a></td>'

[code].....

It puts the entire line into the html so its no good. I'll probably need to use awk (I think).

View 5 Replies View Related

Programming :: Client Side To Include HTML Within HTML?

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

General :: Scsi RAID Jbod And Arrays - Disk Utilization And The Corresponding Low Data Transfer

Jul 6, 2010

So I have a system that is about 6 years old running Redhat 7.2 that is supporting a very old app that cannot be replaced at the moment. The jbod has 7 Raid1 arrays in it, 6 of which are for database storage and another for the OS storage. We've recently run into some bad slowdowns and drive failures causing nearly a week in downtime. Apparently none of the people involved, including the so-called hardware experts could really shed any light on the matter. Out of curiosity I ran iostat one day for a while and saw numbers similar to below:

[Code]...

Some of these kinda weird me out, especially the disk utilization and the corresponding low data transfer. I'm not a disk IO expert so if there are any gurus out there willing to help explain what it is I'm seeing here. As a side note, the system is back up and running it just runs sluggish and neither the database folks nor the hardware guys can make heads or tails of it. Ive sent them the same graphs from iostat but so far no response.

View 1 Replies View Related

Programming :: Parse A File Using Html Parser By Libxml - Undefined Reference

Jan 13, 2011

iḿ trying to parse a file using html parser by libxml.

Code: #include <stdio.h>
#include <libxml/HTMLparser.h>
#include <string.h>
void main(){
printf("main
");
[Code]....

View 4 Replies View Related

Programming :: Importing MYSQL Table From Text File Wo Column Delimiters?

Jun 13, 2011

I am trying to import a data file from old DOS application into MYSQL table The file is clear text file with fixed-width columns, without column delimiters

Example file :
Code:
4444333666666
2222666555555
iiiiwwwcccccc

[Code]...

View 3 Replies View Related

Debian Programming :: HTML Export - Consolidate Several Lines Of CSV File With Firewall Rules

Oct 11, 2013

I have a CSV file, which I created using an HTML export from a Check Point firewall policy. Each rule is represented as several lines, in some cases. That occurs when a rule has several address sources, destinations or services.

I need the output to have each rule described in only one line. It's easy to distinguish when each rule begins. In the first column, there's the rule ID, which is a number.

Here's an example. In green are marked the strings that should be moved:

See example. The strings that should be moved are in bold:

NO.;NAME;SOURCE;DESTINATION;SERVICE;ACTION;
1;;fwgcluster;mcast_vrrp;vrrp;accept;
;;;;igmp;;
2;Testing;fwgcluster;fwgcluster;FireWall;accept;
;;fwmgmpe;fwmgmpe;ssh;;
;;fwmgm;fwmgm;;;

What I need ,explained in pseudo code, is this:

Read the first column of the next line. If there's a number:

Evaluate the first column of the next line. If there's no number there, concatenate (separating with a comma) the strings in the columns of this line with the last one and eliminate the text in the current one

The output should be something like this. The strings in bold are the ones that were moved:

NO.;NAME;SOURCE;DESTINATION;SERVICE;ACTION;
1;;fwgcluster;mcast_vrrp;vrrp-igmp;accept;
;;;;;;
2;Testing;fwgcluster-fwmgmpe-fwmgm;fwgcluster-fwmgmpe-fwmgm;FireWall-ssh;accept;
;;;;;;

The empty lines are there only to be more clear, I don't actually need them.

View 1 Replies View Related

Programming :: Print A Value To A File ?

Apr 12, 2010

I have this code:

How can I print &FARAchieved to a file? Or, printing the whole bioReturn would be fine too.

View 8 Replies View Related

Programming :: Arrays In The C Programming Language Are Pointers To The First Element Of The Array?

Mar 27, 2010

I wonder why arrays in the C programming language are pointers to the first element of the array, not the first element of the array itself?

View 14 Replies View Related

Programming :: Print File Name In BASH

Feb 26, 2009

I want to write a script that returns me name of the files that begin with the specified characters. like

Script out should be

View 3 Replies View Related







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