Sponsored Content
Top Forums Shell Programming and Scripting searching for words between delimeters from the rear Post 302340828 by oktbabs on Tuesday 4th of August 2009 11:40:24 AM
Old 08-04-2009
Power searching for words between delimeters from the rear

Hi,
i need to pick up dates and times from the file names which are of unequal length. The dates and time are delimited by dot. I am interested in getting the strings between the delimeter for fields -3, -4, -5 from behind (rear) so that the out put looks like :

071118.011300.556

I have tried with awk -F'.' '{print $3 '.'$4 '.'$5'}' filename
There is no consistency in the extractiion and i dont know how to read from the back which would have been more consistent.

See examples of filenames below:

nwg_0x005f_200611501-071118.011300.556.d3v4r5.bk

499c-9b4c-7808972f621d.7808972f621d.7808972f621d.7808972f621d.081222.201727.977.d3v70r764.bk

_cheshir.8c671a28-9a9d-42e9-96fd-02304c85bbf3.02304c85bbf3.02304c85bbf3.02304c85bbf3.090219.183923.709.d3v89r1353.bk

HC-071128.002729.081.d3v46r195.bk

al_0x005f_Publish-070724.195338.244.d3v9r20.bk

I need help.

Regards

Last edited by oktbabs; 08-04-2009 at 12:46 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

searching and displaying most commonly used words

Hi guys, i need to search the most commonly occuring words in a file and display their counts of about 30000 words and the words shud not be of typ specified in file 2 e. words like is,for,the,an,he,she etc... k. file1: ALICE was beginning to get very tired of sitting by... (2 Replies)
Discussion started by: arunsubbhian
2 Replies

2. Shell Programming and Scripting

awk with two delimeters

Hi, can anyone explain me below codes...i used the below one to use two delimeter(://) at a time.. but i am not able to understand the output options.. note: here there is no requirement ..only to understand myself about below command... command: awk -F "" '{print $1}' inputfile ... (2 Replies)
Discussion started by: Shahul
2 Replies

3. Shell Programming and Scripting

Searching words in a file containing a pattern

Hi all, I would like to print words in a file seperated by whitespaces containing a specific pattern like "=" e.g. I have a file1 containing strings like %cat file1 The= some= in wish= born <eof> .I want to display only those words containing = i.e The= , some=,wish= ... (5 Replies)
Discussion started by: sree_123
5 Replies

4. Shell Programming and Scripting

Perl searching special words in lines

Hi , i am a new with perl, i want to made a script that find in file rows that start with specil words, as an example a line will start with" ............................................. specialword aaa=2 bbb=5 ............................................. and to put this in a new file... (3 Replies)
Discussion started by: alinalin
3 Replies

5. UNIX for Dummies Questions & Answers

Searching for multiple words on a line in any order issue

Hi again I have figured out how to be able to sort through lines in a file with multiple words in any order and display them using this command: cat file | grep -i $OPTION1 | grep -i $OPTION2 | grep -i $OPTION3 OPTION1 is 2008, OPTION2 is Mar, OPTION 3 is Tue Result: Tue Mar 25... (4 Replies)
Discussion started by: semaj
4 Replies

6. Shell Programming and Scripting

Commas within Delimeters

Hi experts, I would like a favour from you guys to get the info from 5th column which was separated by the delimeter comma ( , ) The Data file is as below:- 1,USER1,"90, TEST AVENUE, OLD ROAD",test1,124,N 2,USER2,88 TEST STREET NEW ROAD,test2,123,N The User File is as below:- USER1... (1 Reply)
Discussion started by: shenkz
1 Replies

7. Shell Programming and Scripting

Awk: Searching for length of words between slash character

Dear UNIX Community, I have a set of file paths like the one below: \\folder name \ folder1 \ folder2 \ folder3 \ folder4 \\folder name \ very long folder name \ even longer name I would like to find the length of the characters (including space) between the \'s. However, I want... (6 Replies)
Discussion started by: vnayak
6 Replies

8. Shell Programming and Scripting

Finding my lost file by searching for words in it

Got a question for you guys...I am searching through a public directory (that has tons of files) trying to find a file that I was working on a longggggg time ago. I can't remember what it is called, but I do remember the content. It should contains words like this: Joe Pulvo botnet zeus... (5 Replies)
Discussion started by: statichazard
5 Replies

9. UNIX for Dummies Questions & Answers

searching words & print prefixed string after it

I have a text which I divided them into sentences and now printed them in a rows. I want to get the list of most of words ( the, and, a) and print 5 words after them (so 6 with the word itself). I have created an acceptfile with those rows and using grep but I have rows that have these words more... (2 Replies)
Discussion started by: A-V
2 Replies

10. Shell Programming and Scripting

Lines between specific delimeters

Hi, I have a requirement like this Line 1 Line 2 Line 3 Manager Line 4 Line 5 I have to print like this Have you done your work on time because I have to forward the work forward. Any Help is really Appriciated.... (1 Reply)
Discussion started by: abhishek7687
1 Replies
DM_ZDUMP(1)						User Contributed Perl Documentation					       DM_ZDUMP(1)

NAME
dm_zdump - timezone dumper SYNOPSIS
This performs the same operation as the unix 'zdump' command, but using the Date::Manip module. dm_zdump [-v] [-c YEAR] [ZONE ZONE ...] DESCRIPTION
This displays the current time in each ZONE named on the command line unless the -v option is given. -h, --help Print online help. -v, --verbose This displays all critical dates (i.e. the times when a time change occurs due to the timezone description) for each of the timezones listed (or the local timezone if none are listed). Each critical date is printed as two lines of output: the last second before the change occurs, and the first second of the new time. By default, all critical dates from Jan 1, 0001 until the year 20 years in the future are printed, but this can be changed with the -c option. -c, --cutoff YEAR This specifies the cutoff year. All critical dates up to the start of YEAR are given. The GMT time Jan 01, YEAR at 00:00:00 is the cutoff time. KNOWN BUGS
None known. BUGS AND QUESTIONS
Please refer to the Date::Manip::Problems documentation for information on submitting bug reports or questions to the author. SEE ALSO
Date::Manip::Date LICENSE
This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself. AUTHOR
Sullivan Beck (sbeck@cpan.org) perl v5.16.3 2014-06-09 DM_ZDUMP(1)
All times are GMT -4. The time now is 06:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy