Sponsored Content
Full Discussion: best practice please
Top Forums Shell Programming and Scripting best practice please Post 302324376 by Mikey on Wednesday 10th of June 2009 02:40:57 PM
Old 06-10-2009
Power best practice please

I have a data file that I tail and dump the data into a new file at midnight.
To work I had to use tail -n2 livefile.csv >> storefile.csv. This is ging me 2 or 3 entries at a time into the storefile.csv.
if I continue this then I will have to run a second pass on the file to remove the duplicates from the csv file. all the files start with the date.
I only need one entry per night.

What is the best way to do this ? I have 6 files to do this to each night.

Thank you

Mike

i.e.

06/06/2009,23:56:04,22.8
06/06/2009,23:56:09,22.8
06/06/2009,23:56:14,22.8
06/07/2009,23:56:09,8.5
06/07/2009,23:56:14,8.5
06/08/2009,23:56:09,-2.5
06/08/2009,23:56:14,-2.5
06/09/2009,23:56:09,-6.9
06/09/2009,23:56:14,-6.9

should be
06/06/2009,23:56:14,22.8
06/07/2009,23:56:14,8.5
06/08/2009,23:56:14,-2.5
06/09/2009,23:56:14,-6.9
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Samba Practice

I have a dual boot machine with both "Windoze ME" and Redhat Linux 7.2. I want to know if it is possible to practice with the Samba Suite on a dual boot machine if I was able to incorporate using IP addresses. I was thinking if your able to ping yourself why wouldn't you be able to administer... (3 Replies)
Discussion started by: bilal_aa
3 Replies

2. Shell Programming and Scripting

What is the best practice?

I'm playing the shell game of moving and deleting files to make room for current DB backup. A set of files gets moved to serverB when serverA threshold is exceeded. I created two scripts one for serverA and one for serverB. Both scripts are run by cron entry. There is a difference of 12 minutes... (4 Replies)
Discussion started by: BigSky
4 Replies

3. Cybersecurity

best practice for logging options

Hi We just had an auditor tell us to formally review our logging parameters on the server and implement best practice for logging, based on a risk assessment. Phew! Before my time here, there was no reasoning behind what we chose to log or not log. Any ideas where such a "best practice"... (1 Reply)
Discussion started by: theonewhowas
1 Replies

4. UNIX for Dummies Questions & Answers

Newbie Wants Hardware For Practice?

I want a cheap dedicated machine to install a flavour of unix on and try to learn this OS. I know nothing about unix, just gone out and bought some books etc. Should I just get the cheapest old laptop off Ebay to install it on? What type of unix OS should I install?...a version of... (5 Replies)
Discussion started by: IBMPBC
5 Replies

5. Shell Programming and Scripting

Best practice for bracket comparisons?

So, I have no formal higher education in programming at all and am self taught. I am now wondering what would be considered best practices? Like should I hard code a variable, then compare it to what I want to know or achieve, or should I just put the commands with in the brackets? Example, a... (5 Replies)
Discussion started by: tlarkin
5 Replies

6. Programming

how to practice my c++ skill

Hi all, I'v already read some basic books about c++ such as <c++ primer>,<The C++ standard library> etc.,and as we know,knowledge is easy to forget without practicing,so i wanna know some ways to practice my skill with programming.First,i know some ACM sites,however,solving problems on those sites... (4 Replies)
Discussion started by: homeboy
4 Replies

7. UNIX for Dummies Questions & Answers

hp ux practice

hi i am new in unix.i have installed linux in my pc,but i want to practice and be expatise in hp ux.but i have no hp server for do it.how could i practice hp ux?please help and give suggestion. (1 Reply)
Discussion started by: dipanjan123
1 Replies

8. UNIX for Dummies Questions & Answers

practice scripting

Is there any sites out there that have examples of things they want you to go and script for practice? I have looked around but have came up empty handed. I have been writing scripts for things I need on my nix box but have am wanting more challenging things to keep me learning. I would prefer... (3 Replies)
Discussion started by: linuxn00b
3 Replies

9. AIX

AIX practice

Dears, Kindly as preparing to get AIX certification I'd like to have your guide & support where can I find dump or exam forms for below :- Test 000-103: AIX 6.1 Basic Operations Test 000-221: AIX 7 Administration I want to look at real questions and try to solve it , is it possible to... (1 Reply)
Discussion started by: arm
1 Replies

10. HP-UX

LVM PE. Best practice

Hi everyone. Unfortunately I can't find advice's about LVM Physical Extent for HPUX. As far as I know we can set for 1PE size from 1MB to 256 MB. But in what cases it should be different? Maybe exist any strict rules, requirements or any best practice? (2 Replies)
Discussion started by: jess_t03
2 Replies
LQR_CARVER_GET_IMAGE_TYPE				     LqR library API reference					 LQR_CARVER_GET_IMAGE_TYPE

NAME
lqr_carver_get_image_type - get the image type of a LqrCarver object SYNOPSIS
#include <lqr.h> LqrImageType lqr_carver_get_image_type(LqrCarver* carver); DESCRIPTION
The function lqr_carver_get_image_type returns the image type (i.e. colour model) of the image contained in the LqrCarver object pointed to by carver. SEE ALSO
LqrImageType(3), lqr_carver_new(3), lqr_carver_set_image_type(3), lqr_carver_get_width(3), lqr_carver_get_height(3), lqr_carver_get_ref_width(3), lqr_carver_get_ref_height(3), lqr_carver_get_channels(3), lqr_carver_get_col_depth(3), lqr_carver_get_enl_step(3), lqr_carver_get_orientation(3) COPYRIGHT
Copyright (C) 2007-2009 Carlo Baldassi LqR library 0.4.1 API (3:1:3) 10 Maj 2009 LQR_CARVER_GET_IMAGE_TYPE
All times are GMT -4. The time now is 02:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy