Many many thanks to you. That was the way I play with your above reply:
Infact on production the filename has the following format:
IGL01_AC_D_<YYYYMMDD>_<N01>_<01>.dat where all the paramaters in angular brakets can be changed. N01 becomes N02 etc, 01 becomes 02 03 etc and
<YYYYMMDD> also.
From your code, I undertstood that -k4,4 is the position in the filename on which I want to sort..am i right?
I used your above logic to sort the file on the three columns with :
Works pretty good..thank you again very much
Last edited by radoulov; 12-27-2011 at 09:17 AM..
Reason: Code tags.
I have a program that will export my data to a single file, but it assigns a file name that is overridden every time I run the program. I need to change the file name to have a sequential number in the filename.
How do I rename a file so that the filename contains the system date and time. I want... (5 Replies)
Hi,
I am new to Unix shell scripting. Can you please help me with this immediate requirement to code.. The requirement is as given below.
In a directory say Y, I have files like this.
PP_100000_28062006_122731_746.dat
PP_100000_28062006_122731_745.dat
PP_100000_28062006_122734_745.dat... (4 Replies)
Hi All,
Sorry to throw this frequent question but I lost my notes on it.
How do you list the files by date? I'm on red hat.
Thanks in advance,
itik (1 Reply)
Hi all,
i'm new here in this forum. I really like the helpful answers in this forum.
Here a short question.
For a script i have to sort files by date and exclude the files of the actual date.
Sorting the files by date and preparing the output for awk is done by this line:
ls -l... (3 Replies)
I know this gets covered quite a bit in the forum and I think there is enough there for me to figure out how to do what I am trying to do, I just don't think I would do it very efficiently so I am going to ask the question...
I have database log files with date and time stamps in the file like
... (7 Replies)
dear all,
i have .dat files named as:
34.dat
2.dat
16.dat
107.dat
i would like to sort them by their filenames as:
2.dat
16.dat
34.dat
107.dat
i have tried numerous combinations of sort and ls command (in vain) to obtain :
107.dat
16.dat
2.dat
34.dat (1 Reply)
Hi all.
I am very new to linux scripting and i have a task i can only solve with a script.
I need to sort files base on the date string in their filenames and create a folder using the same date string then move the files to their respective folders.
Scenario:
Folder Path:... (1 Reply)
Hi all.
I am very new to linux scripting and i have a task i can only solve with a script.
I need to sort files base on the date string in their filenames and create a folder using the same date string then move the files to their respective folders.
Scenario:
Folder Path:... (1 Reply)
I need a unix command which will find all the files greater that a particular date in the file name.
say for example I have files like(filenaming cov : filename.YYDDMMSSSS.txt)
abc.201206015423.txt
abc.201207013456.txt
abc.201202011234.txt
abc.201201024321.txt
efg.201202011234.txt... (11 Replies)
Hi,
I have a list of log files as follows:
name_date_0001_ID0.log
name_date_0001_ID2.log
name_date_0001_ID1.log
name_date_0002_ID2.log
name_date_0004_ID0.log
name_date_0005_ID0.log
name_date_0021_ID0.log
name_date_0025_ID0.log
.......................................... (4 Replies)
Discussion started by: alex2005
4 Replies
LEARN ABOUT DEBIAN
fatsort
fatsort(1) General Commands Manual fatsort(1)NAME
FATSort - FAT filesystem sorting utility
SYNOPSIS
fatsort [options] device
DESCRIPTION
FATsort sorts directory structures of FAT filesystems. Many MP3 hardware players don't sort files automatically but play them in the order
they were transmitted to the device. FATSort can help here.
OPTIONS -c This option causes FATSort to ignore the case of filenames (e.g. 'example.mp3' is equal to 'EXAMPLE.MP3').
-f Force sorting even if the device is mounted or if FATSort cannot determine if the device is mounted.
-h Shows some help information.
-i Prints some file system information of the specified device.
-l FATSort will not sort directory structures, but just print the current order.
-o type
This options specifies how FATSort will sort files and directories. type can be 'd' for directories before files (which is the
default), 'f' for files before directories, or 'a' for no differentiation between files and directories.
-n Uses natural order to sort directory structures instead of alphanumeric order. For example, an alphanumeric order would be
file123.mp3
file21.mp3
file3.mp3
and the corresponding natural order would be
file3.mp3
file21.mp3
file123.mp3.
-q FATSort will work quietly without printing additional information messages.
-r Sorts the directories in reverse order (Z-A).
-R Sorts the directories in random order.
-v Shows version information only.
The following options can be specified multiple times:
-d directory
Sort directory only
-D directory
Sort directory and all subdirectories
-x directory
Don't sort directory
-X directory
Don't sort directory and all subdirectories
-I prefix
Ignore filename prefix prefix during sorting. For example, passing option -I "the " tells FATSort to sort 'The Beatles.mp3' like
'Beatles.mp3'.
EXAMPLES
Sort FAT filesystem on an USB stick:
fatsort /dev/sda1
Sort FAT filesystem in a file:
fatsort /home/user/fat16_fs.img
Sort directory /dir1 and all subdirectories except /dir1/dirA:
fatsort /dev/sda1 -D /dir1 -x /dir1/dirA
Ignore prefixes 'a ' and 'the ' during sorting:
fatsort /dev/sda1 -I "a " -I "the "
AUTHOR
Boris Leidner <fatsort(at)formenos.de>
SEE ALSO mount(8)fsck(8)NOTES
FAT12 is not supported yet.
REPORT BUGS
Please report bugs to fatsort(at)formenos.de. Thanks.
FATSort 0.9.15 2011 fatsort(1)