List files after a certain filename


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers List files after a certain filename
# 1  
Old 11-20-2014
List files after a certain filename

Requirement:

I need to ls all files based on date timestamp after a trigger file

In the below example, I need to pull only files uploaded after orders.bmk by date timestamp ascending.

Code:
ORDERS_0000000009877468.txt
ORDERS_0000000009877464.txt
ORDERS_0000000009877460.txt
ORDERS_0000000009876439.txt
ORDERS_0000000009877454.txt
ORDERS_0000000009875452.txt
ORDERS_0000000009877448.txt
ORDERS_0000000009879664.txt
ORDERS_0000000009877442.txt
ORDERS_0000000009880033.txt
ORDERS_0000000009877436.txt
ORDERS_0000000009878098.txt
ORDERS_0000000009877430.txt
ORDERS_0000000009873565.txt
ORDERS_0000000009877424.txt
ORDERS_0000000009877420.txt
ORDERS_0000000009877416.txt
ORDERS_0000000009876437.txt
ORDERS_0000000009877410.txt
ORDERS_0000000009875450.txt
ORDERS_0000000009877404.txt
ORDERS.bmk
ORDERS_0000000009877398.txt
ORDERS_0000000009880031.txt
ORDERS_0000000009877392.txt
ORDERS_0000000009873563.txt
ORDERS_0000000009877386.txt
ORDERS_0000000009877382.txt
ORDERS_0000000009877378.txt
ORDERS_0000000009876435.txt
ORDERS_0000000009877372.txt
ORDERS_0000000009875448.txt

Is it possible to do it in one line command? My ETL tool only accepts one line commands.
# 2  
Old 11-20-2014
Quote:
Originally Posted by eskay
... In the below example, ...
Are the provided sample lines in a file or output of some command?
# 3  
Old 11-20-2014
in a directory

/home/date/orders/
# 4  
Old 11-20-2014
Yeah, but how did you create this list? I have a command that can produce the expected output but it requires the list you have shown to be in a file or to be the output of some command.
# 5  
Old 11-20-2014
Okay what is the command for file, I can move those into file

/home/data/orders.txt
# 6  
Old 11-20-2014
Code:
sed -n '/ORDERS.bmk/,$ {/ORDERS.bmk/!p}' file | sort -t_ -nk2,2

This User Gave Thanks to junior-helper For This Post:
# 7  
Old 11-21-2014
Thank you! Will try this and let know
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

List filename of files only inside a directory (non-recurrsive) on AIX

I wish to list only files along with the absolute path in a given directory on my AiX 6.1 system. Below is the best I could do. ls -p "/app/scripts"/* This gives a a list of all filename along with folder names with absolute path non-recurrsive (without listing files in sub-directories)... (1 Reply)
Discussion started by: mohtashims
1 Replies

2. UNIX for Dummies Questions & Answers

Output a list of five books with their filename titles into one file

Dear unix forum, could I output a list of five books with their file name titles into one file? In order o output all the contents of all the files with their file names there was: find . -type f | while read x; echo -e "\n$x";cat "$x";done > бетховен.txt In spite of them being successively... (5 Replies)
Discussion started by: Xcislav
5 Replies

3. Shell Programming and Scripting

Help shell script to list filename file_path

HI owner date and time and size of file in a row shell script to list filename file_path i have tried the below code present_dir=`pwd` dir=`dirname $0` list=`ls -lrt | awk {'print $9,$3,$6,$7,$8'}` size=`du -h` path=`cd $dir;pwd;` printf "$list" printf "$path" printf " $size" ... (4 Replies)
Discussion started by: abiram
4 Replies

4. Shell Programming and Scripting

Using bash to separate files files based on parts of a filename

Hey guys, Sorry for the basic question but I have a lot of files that I want to separate into groups based on filenames which I can then cat together. Eg I have: (a_b_c.txt) WB34_2_SLA8.txt WB34_1_SLA8.txt WB34_1_DB10.txt WB34_2_DB10.txt WB34_1_SLA8.txt WB34_2_SLA8.txt 77_1_SLA8.txt... (1 Reply)
Discussion started by: Breentax
1 Replies

5. Shell Programming and Scripting

Using Sort with a filename list

I am using the following to script to sort and process files in order find $eventsFolder${cameraList} -mtime -365 -name \*capture.jpg > /tmp/alarmvideos/${cameraname}.list # use local time settings to order the events right. export LC_ALL=C sort /tmp/alarmvideos/${cameraname}.list -n -o... (1 Reply)
Discussion started by: ddalton
1 Replies

6. Shell Programming and Scripting

Script to List, Modify, replace filename for an upload?

Hello, here is my problem: I have ma program in a first directory dir1: ls path1/rep1/ file1.f90 file1.f90~ file1.o file2.f90 .... etc... I have modified folder in an other directory: ls path2/rep2/ file1_modified.f90 file2_modified.f90 .... etc... All files from first... (8 Replies)
Discussion started by: shadok
8 Replies

7. Shell Programming and Scripting

Filename from splitting files to have the same filename of the original file with counter value

Hi all, I have a list of xml file. I need to split the files to a different files when see the <ko> tag. The list of filename are B20090908.1100-20090908.1200_CDMA=1,NO=2,SITE=3.xml B20090908.1200-20090908.1300_CDMA=1,NO=2,SITE=3.xml B20090908.1300-20090908.1400_CDMA=1,NO=2,SITE=3.xml ... (3 Replies)
Discussion started by: natalie23
3 Replies

8. Shell Programming and Scripting

List files with spaces in filename

I have a text file containing files in a directory structure i.e. /project/hr/raw/jcpdatav/datav_aug03 /project/hr/raw/jcpdatav/comb8121sep02n /project/hr/raw/jcpdatav/datav_feb04_ons /project/hr/raw/jcpdatav/corpsick_jun06 /project/hr/raw/jcpdatav/jcpjoiners200507... (3 Replies)
Discussion started by: mr_crosby
3 Replies

9. Shell Programming and Scripting

read a part of filename from the list in the script

how can i read a part of filename from the list in the script? all file in directory...will start with "CDBACKUPFILE" then the name is stored in list.txt such as JOHN,MARRY,PETER. After this, is seq number. CDBACKUPFILEJOHN00001 CDBACKUPFILEMARRY00004 CDBACKUPFILEPETER00003 I will use:... (3 Replies)
Discussion started by: happyv
3 Replies

10. Shell Programming and Scripting

list only identical filename

Hi Friends, We have four filenames with first few digits are identical.From those files, i need to pick up 2 files based on my parameter. The following example will give more information to understand my question. Files in the directory: small_customer_aa.csv small_customer_ab.csv... (6 Replies)
Discussion started by: HAA
6 Replies
Login or Register to Ask a Question