Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Searching by date range from filenames Post 302450958 by Whit3H0rse on Sunday 5th of September 2010 09:42:27 AM
Old 09-05-2010
Ty people, this works great Smilie

---------- Post updated at 08:42 AM ---------- Previous update was at 03:05 AM ----------

Quote:
Originally Posted by rdcwayx
Code:
ls bookcollection* |awk -F \_ -v start=20100730 -v end=20100802 '{d=substr($1,15); if (d>=start&&d<=end) print}'

SED version works but it is slow because of | sort|, so I prefer AWK, and this code above works great except it doesn't display last day =20100802 it stops on 20100801, also when I choose for example start=20100808
and end=20100808 it display nothing???

I tried modifying code buy my AWK skills are terrible:/, any help?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

searching for filenames with search strings in another file

Hi, I have 5 files in a directory. emp1_usage.txt emp2_usage.txt emp3_usage.txt emp4_usage.txt emp5_usage.txt I am using sqlldr to get the contents of the above 5 files and store it in a temp table and update my original table using temp table. for f in *emp*.txt do sqlldr... (3 Replies)
Discussion started by: pathanjalireddy
3 Replies

2. UNIX for Advanced & Expert Users

Searching filenames containing certain text???

Suppose there are multiple files containing certain text "abc". How to print the name of all such files with a single command from unix prompt? Thanks in advance (6 Replies)
Discussion started by: skyineyes
6 Replies

3. UNIX for Dummies Questions & Answers

Searching for specific filenames

Hi I would like to know how to search through a directory and pull out files that has a specific pattern in the filename. For example if the filename has "bsc" in it, then that file must be moved to another directory where I will perform some operations on it. I know grep can be used, but I'm... (17 Replies)
Discussion started by: ladyAnne
17 Replies

4. Shell Programming and Scripting

Searching the lines within a range of time period in a text file

Dear All, Please advice me, I have a text file with one field date and time like below given. I need to find out the lines whchi content the time stamp between Wed May 26 11:03:11 2010 and Wed May 26 11:03:52 2010 both can be included, using awk command which could be an interactive so that I... (6 Replies)
Discussion started by: chinmayadalai
6 Replies

5. UNIX for Dummies Questions & Answers

Need help in searching a file by range

hi, i need to search a file by range, the file (f3.txt) contains: x1=0123318739 x2=0120123456 x3=0120453576 x4=0110445654 x5=0120432343 x6=0129423 x7=0104323433 x8=01232132134 x9=0122344242 x10=012006196 x11=012016546 x12=012091235 x13=0121064598 x14=012194562 x15=0122028556... (3 Replies)
Discussion started by: takyeldin
3 Replies

6. UNIX for Dummies Questions & Answers

Searching for a pattern from filenames stored in a file

Hi, I have got some 10 filenames stored in a file or displayed in the console as a result of some query i made.. Now I need to open each of these files and search for a pattern in these 10 files.. Can someone help me with this? Thanks, Jean (9 Replies)
Discussion started by: jeanjkj
9 Replies

7. Shell Programming and Scripting

Searching for unknown date inside the file and replace to new date

Hello, Iam a newbies to Shell scripting. Iam trying to replace the date inside the file to new date. is there anyway that we can just use the pattern to search as "..." I have many files want to replace with the same date, and each file contains different date. Thanks for your help. ... (2 Replies)
Discussion started by: Daro
2 Replies

8. Shell Programming and Scripting

Searching same filenames in different partitions

Hi, We are doing some migration work. The same files may exist in different partition/mountpoints. We may place it in a single place, hence we don't want any duplicates...we will rename the file names if we know the files which has duplicates(by file name)). It would be nice if a script... (3 Replies)
Discussion started by: saravanapandi
3 Replies

9. Shell Programming and Scripting

Searching range of filenames witn and without numbers on the end

So I'm grepping for the following right now: ls -la /somedirectory/*.log* | awk '{print $9}' The problem with this is that I get the following output: /somedirectory/errors_1_foo.log /somedirectory/errors_1_foo.log.1 /somedirectory/errors_1_foo.log.2... (4 Replies)
Discussion started by: LinuxRacr
4 Replies

10. UNIX for Dummies Questions & Answers

Find the count of files by last created date based on the given date range

My unix version is IBM AIX Version 6.1 I tried google my requirement and found the below answer, find . -newermt “2012-06-15 08:13" ! -newermt “2012-06-15 18:20" But newer command is not working in AIX version 6.1 unix I have given my requirement below: Input: atr files: ... (1 Reply)
Discussion started by: yuvaa27
1 Replies
GRUB-RENDER-LABEL(1)                                               User Commands                                              GRUB-RENDER-LABEL(1)

NAME
grub-render-label - generate a .disk_label for Apple Macs. SYNOPSIS
grub-render-label [OPTION...] [OPTIONS] DESCRIPTION
Render Apple .disk_label. -b, --bgcolor=COLOR use COLOR for background -c, --color=COLOR use COLOR for text -f, --font=FILE use FILE as font (PF2). -i, --input=FILE read text from FILE. -o, --output=FILE set output filename. Default is STDOUT -t, --text=STRING set the label to render -v, --verbose print verbose messages. -?, --help give this help list --usage give a short usage message -V, --version print program version Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options. REPORTING BUGS
Report bugs to <bug-grub@gnu.org>. SEE ALSO
The full documentation for grub-render-label is maintained as a Texinfo manual. If the info and grub-render-label programs are properly installed at your site, the command info grub-render-label should give you access to the complete manual. grub-render-label (GRUB) 2.02-2ubuntu8.3 July 2018 GRUB-RENDER-LABEL(1)
All times are GMT -4. The time now is 10:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy