07-14-2009
Extracting lines in file based on time
Hi,
anyone has any ideas on how do we extract lines from a file with format similiar to this: (based on current time)
Jun 18 00:16:50 .......... ............. ............
Jun 18 00:17:59 .......... ............. ............
Jun 18 01:17:20 .......... ............. ............
Jun 18 01:18:51 .......... ............. ............
for example: the time now is 01:20:00 and the result will return me records no later than 15mins ago.
Jun 18 01:17:20 .......... ............. ............
Jun 18 01:18:51 .......... ............. ............
by the way, i'm using shell script
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
having a file as follows
MediaErr.log
84 Server1 Policy1 Schedule1 master1 05/08/2008 02:12:16
84 Server1 Policy1 Schedule1 master1 05/08/2008 02:22:47
84 Server1 Policy1 Schedule1 master1 05/08/2008 03:41:26
84 Server1 Policy1 ... (1 Reply)
Discussion started by: karthikn7974
1 Replies
2. Shell Programming and Scripting
Hi,
snp.txt
CHR_A SNP_A BP_A_st BP_A_End CHR_B BP_B SNP_B R2 p-SNP_A p-SNP_B
5 rs1988728 74904317 74904318 5 74960646 rs1427924 0.377333 0.000740085 0.013930081
5 ... (12 Replies)
Discussion started by: genehunter
12 Replies
3. Shell Programming and Scripting
Hi,
I have one file, say file 1, that has data like below where 19900107 is the date,
19900107 12 144 129 0.7380047
19900108 12 168 129 0.3149017
19900109 12 192 129 3.2766666E-02
... (3 Replies)
Discussion started by: Wynner
3 Replies
4. Shell Programming and Scripting
i have something like this in a file called mysqldump.sql
--
-- Table structure for table `Table11`
--
DROP TABLE IF EXISTS `Table11`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Table11` (
`id` int(11) NOT NULL... (14 Replies)
Discussion started by: vivek d r
14 Replies
5. Shell Programming and Scripting
consider the following is the contents of the file
cat 11.sql
drop procedure if exists hoop1 ;
Delimiter $$
CREATE PROCEDURE hoop1(id int)
BEGIN
END
$$
Delimiter ;
.
.
.
.
drop procedure if exists hoop2;
Delimiter $$
CREATE PROCEDURE hoop2(id int)
BEGIN
END
$$ (8 Replies)
Discussion started by: vivek d r
8 Replies
6. Shell Programming and Scripting
hi
i have an input file that contains some thing like this
aaa acc aa abc1 1232 aaa abc2....
poo awq aa abc1 aaa aaa abc2
bbb bcc bb abc1 3214 bbb abc3....
bab bbc bz abc1 3214 bbb abc3....
vvv ssa as abc1 o09 aaa abc4....
azx aaq aa abc1 900 aqq abc19....
aaa aa aaaa abc1 899 aa... (8 Replies)
Discussion started by: anurupa777
8 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I am trying to extract lines from a text file given a text file containing line numbers to be extracted from the first file. How do I go about doing this? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies
8. Shell Programming and Scripting
Hi All,
i have some log files generated in a folder daily with the format
abc.def.20130306.100001
ghi.jkl.20130306.100203
abc.def.20130305.100001
ghi.jkl.20130305.100203
the format is the date followed by time . all i want is to get the files that are generated for todays... (3 Replies)
Discussion started by: mahesh300182
3 Replies
9. Shell Programming and Scripting
Hello,
I have a file ff.txt that looks as follows
*ABNA.txt
356
24
36
112
*AC24.txt
457
458
321
2
ABNA.txt and AC24.txt are the files in the folder named foo1. Based on the numbers in the ff.txt file, I want to extract the lines from the corresponding files in the foo1 folder and... (2 Replies)
Discussion started by: mohamad
2 Replies
10. Shell Programming and Scripting
Hello!
I'm trying to process a text file and am stuck at 2 extractions. Hoping someone can help me here:
1. Given a line in a text file and given a keyword, how can I extract the word preceeding the keyword using a shell command/script?
For example: Given a keyword "world" in the line: ... (2 Replies)
Discussion started by: seemad
2 Replies