Programming :: Filter Last 24 Hour Data And Put In New File?

Aug 30, 2010

i have file server 1 (filesvr01acess.log) and disc server 1 (discsvr01acess.log) in unix box(say ip adress of the box 10.39.66.81)
Similiarly i have file server 2 (filesvr01acess.log) and disc server 2(discsvr01acess.log) in unix box(say ip adress of the box 10.39.66.82). Now my requirement is write sheel script for ..

1. I need only last 24 hour data out of the file server 1 and file server 2 and then finaly put this data in one new file

2. Similiarly same need for discserver 1 and discserver 2.

FYI, each .log files mentioned above is nicely order as date and time as it is created. I can view through cat or search by using grep comand in unix I am wondering if we can achieve through grep command in unix

View 1 Replies


ADVERTISEMENT

Programming :: JFileChooser : Setting The Default 'file Filter'

Sep 28, 2010

Code:

// create a filechooser;
JFileChooser chooser = new JFileChooser(cwd);
FileNameExtensionFilter filter = new FileNameExtensionFilter(
"sdf files (*.sdf)", "sdf");

[code]....

This will give 3 filefilters ('all files', 'sdf files' and 'xml files') for a fileopen dialog. Exactly as I want (in alphanumerical order), but XML is the default extension and I like SDF to be the default extension. Research has not revealed solutions; the setFileFilter method sets the primary filter. If I swap the sequence in the code, SDF becomes the default (as I want) but the sequence is wrong (All, XML, SDF).

View 3 Replies View Related

Fedora Servers :: Data Backup - Will Be Backed Up In Every 1 Hour ?

Jan 8, 2009

How to backup in such way that, data will be backed up in every 1 hour...but every time not full data;; only the data/file which have been modified within last 1 hour. Its on locally. And how to back up local data to remote system. Because I have tried with ssh-keygen also , but everytime its requiring password.

View 1 Replies View Related

Fedora :: KDE Panel Clock To Display In 12 Hour Not 24 Hour Format?

Mar 24, 2010

I recently decided to try KDE4 and would like the change the clock on the panel to display 12 hour format and not the default 24hour format but i can not find where to change this option currently the clock looks like the attached picture. Gnome has this option and I would like to see it in KDE if it exists in the default clock. I am willing to replace the default KDE clock with a seperate widget if one exists for this.

View 1 Replies View Related

Ubuntu Servers :: Filter Out Emails On Postfix Server By GeoIP Data?

Dec 2, 2010

I've been looking for a way to filter out emails on my postfix server by GeoIP data. I couldn't find anything that fitted the bill so wrote my own in Python as a postfix policy. Thought I'd post it here to see if it's of any use to anyone else. I've attached a tar of the files as the Python formatting will get mucked up by the forum code. Comments/improvements are welcome (be kind ) First file is : policyd-geoip which is owned by root:root and placed in /usr/bin with 755 perms

[Code]...

View 3 Replies View Related

Programming :: Get The Data From A Tag In XML File?

Dec 3, 2008

have a tag in XML file in unix like this <EmailAddress>abc@gmail.com</EmailAddress> this tag is there for multiple times in the xml file and the data is in continuous line like below State>UN</State><Zip/><CompanyName/><EmailAddress>FDF@gmail.COM</EmailAddress><PromoType>UNKNOWN</PromoType></Promotion></PromotionList<State>UN</State><Zip/><CompanyName/><EmailAddress>zd4946@gmail.com</EmailAddress>I have to check the data in between bold tags is valid or not ... means have to check whether its a email address or not and have to find the length of the attribute means tag ...script is in kshsorry if its already asked...i checked but i didnt get Exatly matching result for my requirement

View 7 Replies View Related

OpenSUSE :: Switch Over From A 24 Hour To A 12 Hour Format?

Aug 5, 2010

I need to change the time displayed in the task bar from a 24 hour clock to a 12 hour format. I could not find the relevant settings in OpenSuse 11.2 and same is the case for 11.3 as well.

how to make the change? I have tried System Settings ---> Computer Administration ---> Date & Time; but I was not able to make the desired change.

Similarly, I have a digital clock widget that shows GMT + 5.5 hours and I need to change that to 12 hour format as well.

View 3 Replies View Related

Ubuntu :: How Do I Change Time To 12-hour Instead Of 24-hour

Jun 17, 2011

I just switched over to Lubuntu, and so far, it's been great.It's rendering quite well with my laptop, even though the fan is constantly running.I've had some small annoyances that I haven't been able to figure out. How do I get the power button and/or other related actions to the 'start' menu? Is there a way to drag and drop applets like in Ubuntu? How do I setup default brightness like in Ubuntu? How do I change the time to normal US time (12 hour instead of 24 hour)How do I change the time to a 12-hour instead of 24-hour?Is there a software center?

View 2 Replies View Related

Programming :: X BME International 24-hour Contest?

Jan 28, 2010

Do you like programming? Can you take challenges? Would you match yourself with others? Here is your chance! Grab it! The jubilee X. BME International 24-hour Programming Contest will be held this year in May!

This contest is a real test of creativity, knowledge, endurance and team-work, an EXTREME CHALLENGE! Sponsors and the offered prizes worth 6000 euros contribute to the high standards of the contest. The team which gaines the utmost points can take home the award and the cup.[URL]..

View 1 Replies View Related

Programming :: Grep A Particular Data From A File Without Using The Command

May 3, 2010

I want to know that is there any method to grep a particular data from a file without using the "cat --- | grep ' ' " command....I need to use a system call for this functionality.

View 1 Replies View Related

Programming :: C - Open A Txt File And Then Display The Data?

Oct 12, 2010

i want to open a txt file and then read line by line and display data with first line and label it 1 and then incremented by 1 for each additional line.

View 14 Replies View Related

Programming :: Reading A File Of Data In An Array?

Feb 10, 2011

I have two files of data with different numbers of columns and rows. I want to read this two files in two arrays and then compare for example the second column of first data file with the third column of the other text file and if the difference between of two numbers is less than a threshold then the program print the information in the rows which fulfill this condition in the third text file. I have written below program but the problem is that it does not go through all rows of second file.

declare -a a
declare -a b
r=` awk '{n++} END {print n}' second.txt `
echo $r
awk '
{

[Code]....

Actually I have two data files one of them contains 44406 and the other one has 12066 rows and I want to check whether the difference between the components of two specific columns is less than a threshod but I have simplified it here. I had written this code and then I have realized that this code just goes through the number of rows as the same as the first.txt file and ignores the rest. I could not find the problem yet.

View 2 Replies View Related

Programming :: C++ - Store A Text File In A Data Structure?

May 25, 2009

I am writting a program that reads a text file (music.txt) & stores it in a Data Structure. I am a novice learning over the internet so I this is something I have never done. How do I do this?

Quote:

Write a program that reads the data from the music.txt file and store it in a data structure. To implement this data structure you must use an array of songs and each song must be represented by a struct with appropriate fields. So far all I can do is open to file to read it (very simple I know) but so far is it correct?

Code:

#include <iostream>
#include <fstream>
#include <strstream>

[code]....

View 3 Replies View Related

Programming :: Change Data Format In A File Using Bash?

Mar 24, 2010

I want to change data format in a file using bash. The orignal is like:

Code:
1 abc 6 pqr
2 def 7 stu
3 ghij 8 vwx
4 kl 9 yz

[Code]....

View 9 Replies View Related

Programming :: Remove Script Data From File Using Grep & Sed?

Jul 13, 2010

On one of my servers, it appears that a bunch of html files got the following code added to it...Quote:[URL]I was going to try to remove this line using grep & sed... as sample
grep -lr -e 'apples' *.html | xargs sed -i 's/apples/oranges/g'I can get the grep portion to work...

Code:
grep "<script src='http://b.rtbn2.cn/E/J.JS'[>][<]/script[>]" *
But not the sed

View 1 Replies View Related

Programming :: Grab Variables Specified In A Data File And Use Them In The Script?

Dec 23, 2010

I have a script which uses a Menu file (containing several different Menus). I start out with

Code:

Menu=Main

and grep my VRMenuData file for

Code:

$Menu:code:$txtring

where txtring contains the value entered from the keyboard, and cut that line for the code I want executed. So my data looks like:

Quote:

Main:code:1:declare Menu=Download
Main:code:2:soffice -calc VRSched.ods
Main:code:3:echo Load Refresh Menu here

My code acting on the data looks like:

Code:

`grep $Menu:code:$txtring VRMenuData | cut -d: -f4`

When I chose options 1 thru 3, that executes with no problem (Menu=Download does not work). The program sees into field four, but field four is not able to see outside itself. For instance:

Code:

Download:chan:
Download:pitm:1:echo $numpi. Return to Main Menu
Download:pitm:2:

[code]....

is used to generate a numbered list of channels. It could be four or 40. Whatever the number is, I want the next line to read, for example, 32. Return to Main Menu.

Code:

num

is the variable in the script I use to number the list of channels. The number following Download: pitm: is numpi, which should be added to num. How do I take

Code:

Download:pitm:1:echo $numpi. Return to Main Menu

from my VRMenuData file and generate

Code:

32. Return to Main Menu

Code:

$ declare -p Menu
declare -- Menu="Download"
$ declare -p numpi

[code]....

View 3 Replies View Related

Programming :: Translate Data From A CSV File To A MySQL Database?

Aug 26, 2010

I have a CSV called source1 with data like:

Date12:00:00 AM12:30:00 AM01:00:00 AM01:30:00 AM02:00:00 AM02:30:00 AM03:00:00 AM ...
07/31/1051.5252.4852.6452.863.3663.8445.6 ...
08/01/1049.4449.9261.2860.1652.6449.1247.52 ...
08/02/1049.1248.9648.9650.7260.1658.0851.04 ...
08/03/1060.3260.6459.260.9637.9233.2832.8 ...

[Code].....

Also, the CSV file is updates every few hours and I need to load any new data from the file to the database without creating duplicates of data that has already been loaded to the database.

View 6 Replies View Related

Programming :: Use Data Of One File In Another File?

Jul 15, 2010

I have two file file1.txt file2.txt,both file have content like following

file1.txt
Voltage and current behavior for diodes.
v1 2 3 dc 5v
Voltage and current behavior for transistor

[code]....

View 7 Replies View Related

Programming :: Adding Number And String To Each Line In Data File

Apr 10, 2010

I have a very large data file, with 3 numbers in each line, ex. 3 4 5 ; 6 7 8.I want to add two numbers (0 and 1) at the end of every line, and a string at the beginning of the line. Does anyone know a efficient way to do so?

View 7 Replies View Related

Programming :: Store Data In Text File And Be Able To Modify It And Save As Well Using C++?

Jan 25, 2010

I wanna learn how to store data in text file and be able to modify it and save as well using C++.

Note: im using Turbo C++ 3.0

View 9 Replies View Related

Programming :: Add Blank Lines Whenever The Value Of A Given Column Alters In A Data File?

Jan 7, 2011

All I want is a command that reads one data file with several columns and prints it in another one.However, whenever the value in one specific column alters, it prints one empty line in the new file. For example, consider the file

2.54000000 2.54000000
2.54000000 2.54000000
2.54000000 2.54000000
2.54000000 2.56000000

[code]....

View 9 Replies View Related

Programming :: Getting A Script To Continuously Monitor Appended Data To A Log File?

Oct 13, 2010

Code:

if ! [ -f ${PATH}/myfile.txt ];then
echo $(date +%Y%m%d"_"%H%M%S)": Nu am gasit fisierul ${PATH}/myfile.txt"
ps -fxu pin | grep "/usr/local/coreutils/bin/tail -f ${LOG_PATH}/x.log$" | awk '{system("kill "$2)}'
cat ${LOG_PATH}/x.log | sed -n -e '/LONG/{x;1!p;g;;}' -e h > ${PATH}/myfile.txt

[code]....

I have a continuously growing log file (x.log) in which i have to look for certain lines that contain "Long". The line above each line containing the word "Long" it contains a time stamp. I want to extract each line containing the time stamp into myfile.txt and check the difference between time stamps. Whenever there is a difference i need to run another script (${CAL_PATH}/${APP_NAME}), then sleep 1, then continue searching. Lines with "Long" do not appear continuously, but in blasts. The script runs fine until the first pause encountered. Starting with the first pause, tail -f doesn't write in myfile.txt anymore. Can someone help me understand why "tail -f" it stops writing into myfile.txt? Or does someone know an alternative to "tail -f" of achieving the initial scope of the script?

View 5 Replies View Related

Programming :: Using Piped Data As Input - Cannot Stat '-': No Such File Or Directory

Nov 6, 2010

Code: stuart@stuart:~/$cat showthread.php.html | grep -o [URL][^"< ]*" | uniq | head -n3 | plowdown - cannot stat '-': No such file or directory Code: stuart@stuart:~/$ awk NR==$x Musiclist.txt | cut -d/ -f6 | basename $1 .mp3 .mp3 Here's some system info on the bash i'm using:

[Code]...

View 13 Replies View Related

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 View Related

Programming :: Write Data To Text File Which Is Coming On Serial Port Infintely?

Aug 5, 2010

trying read serial COM port and want to write that received data to file, now its writing only one sentence, but i want to write full file which coming on serial port, as i'm sending file from hyper terminal and reading on linux pc, If i put while loop its not writing anything,without while loop its writing only one line and if send big file then application terminates and then writes to file.But i need do write any size which coming on serial port.Finally i want write full file which is coming on hyper terminal, after writing the file it has wait for next data. This is my code,

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

[code]...

View 9 Replies View Related

Programming :: Bash Script: Sort Files Into Directory Based On Data In The File Name?

Sep 28, 2010

I have very little linux experience. And need some help with a bash script. I need to a script I can set cron to run to sort files out of a holding folder into final folders. It doesn't necessarily have to be bash, but I think it would be sufficient for this. File names are formatted as such when created: Dest-Date-Time-CID-Destination# I want the files to be moved from a all in one holding folder to a folder structure like this.

.../storage/year/month/day/Destination#/VarX(type)/hour/CID/'File'

I would need an if/else if/else statement to say if Dest = A set VarX = B If for example the file name was

infinity-20100927-17:00-1112223333-4445556666.wav

I would like the above file to end up moved from

.../holding

to

.../storage/2010/09/27/4445556666/Inbound/17/1112223333/infinity-20100927-17:00-1112223333-4445556666.wav

So the script will need to make directories based on information in the file name which is delimited by single dashes. Then move files from the holding folder to the newly created "sorted" folders.

View 15 Replies View Related

Programming :: Get Data From Multi Lined Text File Using Awk / Sed Or Perl - Grep And Cut Not Upto Par?

Jul 1, 2010

I need a loop that pulls out the user name into a variable and then pulls out the LastUpdate field into another variable so I can then perform a comparison against the last update field. Requirements are AIX tools including AWK, SED and Perl I am writing a script to check AIX users password expiration dates and if they are within the alerting period (ie. 7 days etc) it will email the user. I will release the full script into the public domain once completed. The text file I want to parse is formatted like:

Code:

colettel:
password = XSON0m4SdIQDw
lastupdate = 1260829398
andrewwa:

[code].....

View 4 Replies View Related

Programming :: Saving File Data Using Python In An Embedded System In An Safe And Fast Way?

Apr 19, 2011

I am developing a program in a system where the Linux does not take care of the sync command automatically. So I have to run it from my application always I save some data in the disk, which in my case is a 2GB sdcard. It is true that I can make the operation system takes care of the syncronization, using a proper mount option, but in this case the programm's performance drops drastically. In particular I use the shelve module from Python to save data that comes from a socket/TCP connection and I have to deal with the potencial risk of the system being turned off suddenly Initially I wrote something like that to save data using shelve:

Code:

def saveData(vo)
fd = shelve.open( 'fileName' , 'c')
fd[ key ] = vo
fd.close()
os.system("sync")

But that takes too much time to save the data. Note that I use the sync from the OS every time I close a file to prevent data corruption in the case of the "computer" being turned off with data even in the buffer. To improve the performance I made something like that:

Code:

def saveListData( list )
fd = shelve.open('file_name', 'c')
for itemVo in list:
fd[itemVo.key] = itemVo
fd.close()
os.system("sync")

Thus, first I saved an amount of objects in a list then I open the file and save the objects. In this way I have to open the file just one time to save a lot of objects.However I would like to know if adding a lot of objects before closing the file would increase the risk of data corruption.I known that turning off the system after fd.close() and before os.sync may cause problems. But what about turning off the system after

Code:

fd = shelve.open('file_name', 'c')

but before fd.close()?

View 7 Replies View Related

Programming :: Bash: Using Grep To Filter 25 Or Above?

Dec 3, 2010

i have a sample that looks like this:

Code:
[schneidz@hyper temp]$ wget -q --output-document=- http://world.needforspeed.com/SpeedAPI/ws/game/nfs-w/leaderboards/events

[code]....

View 2 Replies View Related

Programming :: Filter ASCII Characters PHP?

Mar 8, 2010

How can I filter ASCII quotes( ' ) and double quotes ( " ) so that I can replace them with the UTF-8 equivalent?If I copy text from a Word Document(ASCII), and upload it to a web page with PHP. The Database(UTF-8) will replace these racters with incorrect character(s).I need some function that will replace these characters but I don't know how to differentiate the ASCII quotes and the UTF-8 Quotes without (somehow) converting the string to hex, then preg_replace'ing the hex code for the symbol.

View 8 Replies View Related







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