Sponsored Content
Top Forums Shell Programming and Scripting Dont have a clue which program to use to process flying bat data Post 302499399 by cmp260 on Thursday 24th of February 2011 10:02:35 AM
Old 02-24-2011
which is better in your opinion? -p.s. data was wrong

I'm curious now, what shell would allow this to be achieved in 5 or 6 lines of code?

Further to the solutions, I got something wrong see below,Smilie (I didn't have the data to hand when I wrothe the question) and there are actually some complicating factors: the logger automatically stores the data in new directories each day, the dir name is the date (in the format 2011-01-31) but it is not stored in the line of text as I thought originally -sorry about that. Data is held in identical logfile.txt in each of the date directories but there is other data in the file that can be ignored.
If is is still even possible for the script to work properly, is there any way to run the script automatically on each of the directories in turn and append the date to the time of each transit? And even output a single file concatenating all the processed data?

below is an actual example of a logfile.txt (real bat transits) and Ive attached a series of actual files and directories as zip
Code:
Tx->06:32:34,ev,1
Rx<-06:32:35,ev,1
Tx->06:53:46,ev,1
Rx<-06:53:46,ev,1
Tx->06:54:18,ev,1
Rx<-06:54:18,ev,1
Rx<-07:01:36,pv,1,1
Rx<-07:01:36,pv,0,1
Rx<-07:01:36,pv,0,0
Rx<-07:01:36,pv,0,1
Rx<-07:01:37,pv,0,0
Rx<-07:01:37,pv,1,0
Rx<-07:01:37,pv,1,1
Rx<-07:01:38,pv,0,1
Rx<-07:01:38,pv,0,0
Rx<-07:01:38,pv,1,0
Rx<-07:02:52,pv,1,1
Rx<-07:02:53,pv,1,0
Rx<-07:04:55,pv,1,1
Rx<-07:04:55,pv,0,1
Rx<-07:04:56,pv,0,0
Rx<-07:04:56,pv,1,0
Rx<-07:05:03,pv,1,1
Rx<-07:05:04,pv,1,0
Tx->07:14:12,ev,1
Rx<-07:14:12,ev,1
Rx<-07:14:53,pv,1,1
Rx<-07:14:53,pv,0,1
Rx<-07:14:54,pv,0,0
Rx<-07:14:54,pv,1,0
Rx<-07:14:58,pv,1,1
Rx<-07:14:58,pv,0,1
Rx<-07:14:59,pv,0,0
Rx<-07:14:59,pv,1,0
Rx<-08:06:41,tv,21.5;;;;;
Rx<-08:59:20,pv,0,1
Rx<-08:59:20,pv,0,0
Rx<-08:59:20,pv,0,1
Rx<-08:59:20,pv,0,0
Rx<-08:59:20,pv,0,1
Rx<-08:59:20,pv,1,1
Rx<-08:59:20,pv,1,0
Rx<-08:59:20,pv,1,1
Rx<-08:59:20,pv,0,0
Rx<-08:59:20,pv,1,0
Rx<-09:00:26,tv,22.0;;;;;
Rx<-09:17:52,pv,0,1
Rx<-09:17:52,pv,1,1
Rx<-09:17:52,pv,0,0
Rx<-09:17:52,pv,1,0
Rx<-09:27:36,pv,0,1
Rx<-09:27:36,pv,0,0
Rx<-09:27:36,pv,1,1
Rx<-09:27:36,pv,0,1
Rx<-09:27:36,pv,1,0
Rx<-09:27:36,pv,1,1
Rx<-09:27:36,pv,1,0
Rx<-09:27:36,pv,0,0
Rx<-09:35:15,pv,0,1
Rx<-09:35:15,pv,0,0
Rx<-09:35:15,pv,0,1
Rx<-09:35:15,pv,1,1
Rx<-09:35:15,pv,0,0
Rx<-09:35:15,pv,1,0
Rx<-09:35:33,pv,1,1
Rx<-09:35:33,pv,0,1
Rx<-09:35:33,pv,1,0
Rx<-09:35:33,pv,0,0
Rx<-09:49:50,pv,1,1
Rx<-09:49:50,pv,0,1
Rx<-09:49:50,pv,1,0
Rx<-09:49:50,pv,0,0
Rx<-09:54:12,tv,22.5;;;;;
Rx<-09:58:20,pv,0,1
Rx<-09:58:20,pv,0,0
Rx<-09:58:20,pv,0,1
Rx<-09:58:20,pv,1,1
Rx<-09:58:20,pv,0,0
Rx<-09:58:20,pv,1,0
Rx<-10:06:32,pv,1,1
Rx<-10:06:32,pv,0,1
Rx<-10:06:32,pv,0,0
Rx<-10:06:32,pv,0,1
Rx<-10:06:32,pv,0,0
Rx<-10:06:32,pv,0,1
Rx<-10:06:32,pv,1,0
Rx<-10:06:32,pv,0,0
Rx<-10:19:07,pv,0,1
Rx<-10:19:07,pv,1,1
Rx<-10:19:07,pv,0,0
Rx<-10:19:07,pv,1,0
Rx<-10:33:13,pv,1,1
Rx<-10:33:13,pv,1,0
Rx<-10:33:13,pv,1,1
Rx<-10:33:13,pv,0,1
Rx<-10:33:13,pv,1,0
Rx<-10:33:13,pv,0,0
Rx<-10:47:57,tv,22.5;;;;;
Rx<-11:41:43,tv,22.5;;;;;
Rx<-11:45:56,pv,0,1
Rx<-11:45:56,pv,1,1
Rx<-11:45:56,pv,0,0
Rx<-11:45:56,pv,1,0
Rx<-11:50:00,pv,1,1
Rx<-11:50:00,pv,0,1
Rx<-11:50:00,pv,0,0
Rx<-11:50:00,pv,0,1
Rx<-11:50:00,pv,1,0
Rx<-11:50:00,pv,0,0
Rx<-11:59:41,pv,0,1
Rx<-11:59:41,pv,1,1
Rx<-11:59:41,pv,0,0
Rx<-11:59:41,pv,1,0
Rx<-11:59:49,pv,1,1
Rx<-11:59:49,pv,1,0
Rx<-11:59:49,pv,0,1
Rx<-11:59:49,pv,0,0
Rx<-11:59:49,pv,1,1
Rx<-11:59:49,pv,0,1
Rx<-11:59:49,pv,0,0
Rx<-11:59:49,pv,0,1
Rx<-11:59:49,pv,0,0
Rx<-11:59:49,pv,0,1
Rx<-11:59:49,pv,1,0
Rx<-11:59:49,pv,0,0
Rx<-11:59:49,pv,0,1
Rx<-11:59:49,pv,0,0
Rx<-12:00:16,pv,0,1
Rx<-12:00:16,pv,1,1
Rx<-12:00:16,pv,0,0
Rx<-12:00:16,pv,1,0
Rx<-12:16:07,pv,1,1
Rx<-12:16:07,pv,0,1
Rx<-12:16:07,pv,1,0
Rx<-12:16:07,pv,1,1
Rx<-12:16:07,pv,1,0
Rx<-12:16:07,pv,0,0
Rx<-12:16:07,pv,1,1
Rx<-12:16:07,pv,0,1
Rx<-12:16:07,pv,1,0
Rx<-12:16:07,pv,0,0
Rx<-12:35:28,tv,22.5;;;;;
Rx<-13:29:13,tv,22.5;;;;;
Rx<-14:22:54,tv,21.5;;;;;
Rx<-15:16:40,tv,22.5;;;;;
Rx<-15:17:29,pv,1,1
Rx<-15:17:29,pv,0,1
Rx<-15:17:29,pv,1,0
Rx<-15:17:29,pv,0,0
Rx<-15:17:29,pv,0,1
Rx<-15:17:29,pv,0,0
Rx<-15:33:30,pv,1,1
Rx<-15:33:30,pv,1,0
Rx<-15:33:30,pv,1,1
Rx<-15:33:30,pv,1,0
Rx<-15:33:30,pv,1,1
Rx<-15:33:30,pv,0,1
Rx<-15:33:31,pv,1,0
Rx<-15:33:31,pv,1,1
Rx<-15:33:31,pv,0,0
Rx<-15:33:31,pv,1,0
Rx<-15:33:31,pv,0,1
Rx<-15:33:31,pv,0,0
Rx<-15:33:31,pv,0,1
Rx<-15:33:31,pv,0,0
Rx<-15:33:31,pv,0,1
Rx<-15:33:31,pv,0,0
Rx<-15:35:23,pv,1,1
Rx<-15:35:23,pv,0,1
Rx<-15:35:23,pv,1,0
Rx<-15:35:23,pv,0,0
Rx<-15:35:24,pv,1,1
Rx<-15:35:24,pv,1,0
Rx<-15:35:24,pv,1,1
Rx<-15:35:24,pv,1,0
Rx<-15:35:24,pv,1,1
Rx<-15:35:24,pv,0,1
Rx<-15:35:24,pv,1,0
Rx<-15:35:24,pv,0,0
Rx<-16:10:25,tv,22.5;;;;;
Rx<-16:26:09,pv,1,1
Rx<-16:26:09,pv,1,0
Rx<-16:26:09,pv,1,1
Rx<-16:26:09,pv,1,0
Rx<-16:26:09,pv,1,1
Rx<-16:26:09,pv,1,0
Rx<-16:26:09,pv,1,1
Rx<-16:26:09,pv,1,0
Rx<-16:26:09,pv,1,1
Rx<-16:26:09,pv,0,1
Rx<-16:26:09,pv,0,0
Rx<-16:26:09,pv,0,1
Rx<-16:26:09,pv,0,0
Rx<-16:26:09,pv,0,1
Rx<-16:26:09,pv,1,0
Rx<-16:26:09,pv,0,0
Rx<-16:26:10,pv,0,1
Rx<-16:26:10,pv,0,0
Rx<-16:26:10,pv,0,1
Rx<-16:26:10,pv,0,0
Rx<-16:26:10,pv,0,1
Rx<-16:26:10,pv,0,0
Rx<-17:00:51,pv,1,1
Rx<-17:00:51,pv,1,0
Rx<-17:00:51,pv,1,1
Rx<-17:00:51,pv,0,1
Rx<-17:00:51,pv,0,0
Rx<-17:00:51,pv,0,1
Rx<-17:00:51,pv,1,0
Rx<-17:00:51,pv,0,0
Rx<-17:04:10,tv,22.5;;;;;
Rx<-17:22:08,pv,0,1
Rx<-17:22:08,pv,0,0
Rx<-17:22:08,pv,0,1
Rx<-17:22:08,pv,1,1
Rx<-17:22:08,pv,0,0
Rx<-17:22:08,pv,1,0
Rx<-17:27:04,pv,0,1
Rx<-17:27:04,pv,0,0
Rx<-17:27:04,pv,0,1
Rx<-17:27:04,pv,1,1
Rx<-17:27:04,pv,0,0
Rx<-17:27:04,pv,0,1
Rx<-17:27:04,pv,0,0
Rx<-17:27:04,pv,1,0
Rx<-17:27:04,pv,1,1
Rx<-17:27:04,pv,1,0
Rx<-17:27:04,pv,1,1
Rx<-17:27:04,pv,1,0
Rx<-17:32:54,pv,0,1
Rx<-17:32:54,pv,1,1
Rx<-17:32:54,pv,1,0
Rx<-17:32:54,pv,1,1
Rx<-17:32:54,pv,0,0
Rx<-17:32:54,pv,1,0
Rx<-17:32:54,pv,1,1
Rx<-17:32:54,pv,1,0
Rx<-17:33:19,pv,1,1
Rx<-17:33:19,pv,1,0
Rx<-17:33:19,pv,1,1
Rx<-17:33:19,pv,1,0
Rx<-17:33:19,pv,1,1
Rx<-17:33:19,pv,1,0
Rx<-17:33:19,pv,1,1
Rx<-17:33:19,pv,1,0
Rx<-17:34:17,pv,0,1
Rx<-17:34:17,pv,1,1
Rx<-17:34:17,pv,0,0
Rx<-17:34:17,pv,1,0
Rx<-17:35:52,pv,0,1
Rx<-17:35:52,pv,0,0
Rx<-17:35:52,pv,0,1
Rx<-17:35:52,pv,0,0
Rx<-17:35:52,pv,0,1
Rx<-17:35:52,pv,0,0
Rx<-17:35:52,pv,0,1
Rx<-17:35:52,pv,1,1
Rx<-17:35:52,pv,0,0
Rx<-17:35:52,pv,0,1
Rx<-17:35:52,pv,0,0
Rx<-17:35:52,pv,0,1
Rx<-17:35:52,pv,0,0
Rx<-17:35:52,pv,1,0
Rx<-17:40:58,pv,0,1
Rx<-17:40:58,pv,1,1
Rx<-17:40:58,pv,1,0
Rx<-17:40:58,pv,1,1
Rx<-17:40:58,pv,0,0
Rx<-17:40:58,pv,1,0
Rx<-17:57:56,tv,22.0;;;;;
Rx<-18:36:44,pv,1,1
Rx<-18:36:44,pv,1,0
Rx<-18:36:44,pv,1,1
Rx<-18:36:44,pv,1,0
Rx<-18:36:44,pv,1,1
Rx<-18:36:44,pv,1,0
Rx<-18:36:44,pv,1,1
Rx<-18:36:44,pv,0,1
Rx<-18:36:44,pv,1,0
Rx<-18:36:44,pv,0,0
Rx<-18:51:41,tv,22.0;;;;;
Rx<-18:56:18,pv,1,1
Rx<-18:56:18,pv,1,0
Rx<-18:56:18,pv,1,1
Rx<-18:56:18,pv,1,0
Rx<-18:56:18,pv,1,1
Rx<-18:56:19,pv,1,0
Rx<-18:56:19,pv,1,1
Rx<-18:56:19,pv,1,0
Rx<-18:56:47,pv,1,1
Rx<-18:56:47,pv,1,0
Rx<-18:56:47,pv,1,1
Rx<-18:56:47,pv,0,1
Rx<-18:56:47,pv,1,0
Rx<-18:56:47,pv,0,0
Rx<-18:56:47,pv,1,1
Rx<-18:56:47,pv,0,1
Rx<-18:56:47,pv,0,0
Rx<-18:56:47,pv,0,1
Rx<-18:56:47,pv,1,0
Rx<-18:56:47,pv,0,0
Rx<-19:25:05,pv,0,1
Rx<-19:25:05,pv,0,0
Rx<-19:25:05,pv,0,1
Rx<-19:25:05,pv,0,0
Rx<-19:25:05,pv,0,1
Rx<-19:25:05,pv,1,1
Rx<-19:25:05,pv,0,0
Rx<-19:25:05,pv,1,0
Rx<-19:27:08,pv,1,1
Rx<-19:27:09,pv,1,0
Rx<-19:27:09,pv,1,1
Rx<-19:27:09,pv,0,1
Rx<-19:27:09,pv,1,0
Rx<-19:27:09,pv,1,1
Rx<-19:27:09,pv,0,0
Rx<-19:27:09,pv,0,1
Rx<-19:27:09,pv,1,0
Rx<-19:27:09,pv,0,0
Rx<-19:32:26,pv,0,1
Rx<-19:32:26,pv,1,1
Rx<-19:32:26,pv,0,0
Rx<-19:32:26,pv,1,0
Rx<-19:32:57,pv,1,1
Rx<-19:32:57,pv,1,0
Rx<-19:32:57,pv,1,1
Rx<-19:32:57,pv,1,0
Rx<-19:32:57,pv,1,1
Rx<-19:32:57,pv,1,0
Rx<-19:32:57,pv,1,1
Rx<-19:32:57,pv,1,0
Rx<-19:32:59,pv,1,1
Rx<-19:32:59,pv,0,1
Rx<-19:32:59,pv,0,0
Rx<-19:32:59,pv,0,1
Rx<-19:32:59,pv,1,0
Rx<-19:33:00,pv,0,0
Rx<-19:33:22,pv,1,1
Rx<-19:33:22,pv,1,0
Rx<-19:33:22,pv,1,1
Rx<-19:33:22,pv,0,1
Rx<-19:33:22,pv,0,0
Rx<-19:33:22,pv,0,1
Rx<-19:33:22,pv,1,0
Rx<-19:33:22,pv,0,0
Rx<-19:33:46,pv,0,1
Rx<-19:33:46,pv,1,1
Rx<-19:33:46,pv,0,0
Rx<-19:33:46,pv,1,0
Rx<-19:45:27,tv,22.0;;;;;
Rx<-19:49:08,pv,0,1
Rx<-19:49:08,pv,0,0
Rx<-19:49:08,pv,0,1
Rx<-19:49:08,pv,1,1
Rx<-19:49:08,pv,0,0
Rx<-19:49:08,pv,1,0
Rx<-19:49:24,pv,1,1
Rx<-19:49:24,pv,1,0
Rx<-19:49:24,pv,1,1
Rx<-19:49:24,pv,0,1
Rx<-19:49:24,pv,1,0
Rx<-19:49:24,pv,0,0
Rx<-19:59:33,pv,1,1
Rx<-19:59:33,pv,0,1
Rx<-19:59:33,pv,1,0
Rx<-19:59:33,pv,0,0
Rx<-19:59:33,pv,0,1
Rx<-19:59:33,pv,1,1
Rx<-19:59:33,pv,1,0
Rx<-19:59:33,pv,1,1
Rx<-19:59:33,pv,0,0
Rx<-19:59:33,pv,1,0
Rx<-19:59:33,pv,1,1
Rx<-19:59:33,pv,0,1
Rx<-19:59:33,pv,0,0
Rx<-19:59:33,pv,0,1
Rx<-19:59:33,pv,1,0
Rx<-19:59:33,pv,1,1
Rx<-19:59:33,pv,1,0
Rx<-19:59:33,pv,1,1
Rx<-19:59:33,pv,1,0
Rx<-19:59:33,pv,0,0
Rx<-20:39:12,tv,21.5;;;;;
Rx<-20:51:29,pv,0,1
Rx<-20:51:29,pv,1,1
Rx<-20:51:29,pv,1,0
Rx<-20:51:29,pv,1,1
Rx<-20:51:29,pv,1,0
Rx<-20:51:29,pv,0,0
Rx<-20:51:29,pv,1,1
Rx<-20:51:29,pv,0,1
Rx<-20:51:29,pv,1,0
Rx<-20:51:29,pv,0,0
Rx<-20:51:29,pv,0,1
Rx<-20:51:29,pv,1,1
Rx<-20:51:29,pv,0,0
Rx<-20:51:29,pv,1,0
Rx<-20:58:57,pv,1,1
Rx<-20:58:57,pv,1,0
Rx<-20:58:57,pv,1,1
Rx<-20:58:57,pv,1,0
Rx<-20:58:57,pv,1,1
Rx<-20:58:57,pv,0,1
Rx<-20:58:57,pv,1,0
Rx<-20:58:57,pv,0,0
Rx<-20:59:07,pv,0,1
Rx<-20:59:07,pv,1,1
Rx<-20:59:07,pv,0,0
Rx<-20:59:07,pv,1,0
Rx<-21:27:57,pv,0,1
Rx<-21:27:57,pv,1,1
Rx<-21:27:57,pv,0,0
Rx<-21:27:57,pv,0,1
Rx<-21:27:57,pv,0,0
Rx<-21:27:57,pv,0,1
Rx<-21:27:57,pv,0,0
Rx<-21:27:57,pv,0,1
Rx<-21:27:57,pv,0,0
Rx<-21:27:57,pv,1,0
Rx<-21:32:58,tv,21.0;;;;;
Rx<-22:26:43,tv,21.0;;;;;
Rx<-23:20:28,tv,21.0;;;;;

many thanks for the assistance so far.
cmpSmilie

Last edited by Scott; 02-24-2011 at 03:58 PM.. Reason: Code tags
 

9 More Discussions You Might Find Interesting

1. HP-UX

IO by Process/program

HI there, I'm trying to find a way of showing the IO's performed by individual programs. Number of reads/writes IO time that kind of thing. Anybody know of any way to show this information. Free little downloads that kind of thing? Cheers Phil (2 Replies)
Discussion started by: cpiuk
2 Replies

2. HP-UX

get program name give a process id

Hi , I have query regarding to get a program name given a pid in HP-Ux . give procees id ( PID) i would like to retrieve the process/program through a C program ? my input to c program will be will be pid and i would like to know what is process name /program name . Many Thanks ... (1 Reply)
Discussion started by: naren_chella
1 Replies

3. Programming

Getting process info in a program

Hi, I am wondering if there is a way to find out in a C software program if a particular process is running without having to write a file. In the past, I have been using the system command to execute a pgrep and output the info to a file. Then the C program reads the file to make the... (1 Reply)
Discussion started by: herbmiller
1 Replies

4. Programming

How to start a process in linux using C program??

I have a set of attributes such as group id,group name,etc related to a linux process. Iwant to know how to start a process in linux using C program.Plz do help me. (3 Replies)
Discussion started by: vigneshinbox
3 Replies

5. Programming

Process creation in Unix with C Program

Hi, can somebody please help me regarding this? How can i print parent's PID from child's and vice versa. I have tried with getpid() & ngetppid() function but it is not giving me the correct data. The logic i used is: if (pid == 0) { getpid() : Chil'd PID getppid():... (1 Reply)
Discussion started by: dsudipta
1 Replies

6. UNIX for Dummies Questions & Answers

defunct process occuring in a particular program

All, I am getting a wired scenario, Not all times but some times i am getting the defunct process for a program. If i rerun the same program it is working fine.This defunct scenario is not occuring often. And this is happening only for the one program in my system that to sometimes Can you... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies

7. Shell Programming and Scripting

dont have a clue again- flying bat data new logger

hi, this is related to this thread https://www.unix.com/shell-programming-scripting/154822-dont-have-clue-program-use-process-flying-bat-data.html using another type of logger (ipcas ipether232) which produces csv data but not seperated into differnt folders. I need to work out how to get... (2 Replies)
Discussion started by: cmp260
2 Replies

8. Shell Programming and Scripting

How can I get parent process program name?

Hi: I have 2 script on AIX server. The child script is called by parent script. For example: The parent script full name is /home/op/def/parent.spt, which calls /home/op/abc/child.spt I want to get the parent program name with full path name (i.e. /home/op/def/parent.spt), in... (3 Replies)
Discussion started by: cstsang
3 Replies

9. Shell Programming and Scripting

I dont want to exit the program by ctrl + c

Hey , guys I am new to shell programing ,, so need a help from you guys ... I have to write a shell script that accepts file name or directory name from the user if it is a directory then throw an error if it is a file then give the user two options . 1.overwrite the content 2.append the... (2 Replies)
Discussion started by: coolashu
2 Replies
All times are GMT -4. The time now is 10:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy