I'm stumped on the point of sorting the file at the end. The first line you write to identify the file will be very unlikely to stay with the content, and the content itself may not stay in order either.
What are you trying to achieve? There is probably a far neater way to achieve it as Don alludes to, but we would need to know what inputs/files you have and what is the required output.
For instance:-
Quote:
I have three directories (for testing) dir-a, dirb and dir-c
They all contain separate files file-a, file-b & file-c respectively
Each file contains my data.
The output I want is:-
You would be best to tell us which bits need to be sorted (reverse) and which bits need to remain as they are.
I'm sure we can help if we fully understand the problem.
I a file with log entries... I want to sort it so that the last line in the file is first and the first line is last..
eg.
Sample file
1
h
a
f
8
6
After sort should look like
6
8
f
a
h
1 (11 Replies)
I need to sort the particular column only in reverse order how i can give it..
if i give the -r option the whole file is getting sorted in reverse order.
1st 2nd col 3rd
C col 4th col 5th col
-------------------------------------------
C... (7 Replies)
Hi Everyone,
I have one a.txt:
a b 001 c
b b 002 c
c c, not 002 c
The output should be
001
002
002
If i use cut -f 3 -d' ', this does not work on the 3rd line, so i thought is any way to cut the field counting from the end? or any perl thing can do this?:confused:
... (3 Replies)
command/script(apart from awk) to print the fields in reverse order
that is last field has to come first and so on and first field has to go last
Input
store-id date sale
.............
.............
... (3 Replies)
Hi,
I want to print the item in reverse order such that the output would look like
00 50 50 23 40 22 02 96
Below is the input:
00 05 05 32 04 22 20 69
Video tutorial on how to use code tags in The UNIX and Linux Forums. (5 Replies)
Hello,
I have a large database of words and would like them sorted in reverse order i.e. from the end up.
An example will make this clear:
I have tried to write a program in Perl which basically takes the string from the end and tries to sort from that end but it does not seem... (5 Replies)
Hi all,
i have dynamic file 'xyz.txt', records always look likes below format ...
0000021 RET 31-MAR-1984 FAP
0000021 DTA 14-JAN-2003 CNV
0000021 DTA 25-MAR-2012 DTA
0000021 DTA 26-MAR-2012 DTA
#################################################
0000021 DTA ... (4 Replies)
Discussion started by: krupasindhu18
4 Replies
LEARN ABOUT DEBIAN
dcfile
DCFILE(1) DICOM PS3 - Describe DICOM file content DCFILE(1)NAME
dcfile - ACR/NEMA DICOM PS3 ... DICOM PS3 - Describe DICOM file content
SYNOPSIS
dcfile [ -b|brief ] [ -filename ]
DESCRIPTION
dcfile reads the named dicom or acr-nema input file and describes the encoding method of the file, ie. what transfer syntax is in use, and
whether or not a Part 10 style meta-information header is present.
OPTIONS
The description goes to standard error.
The basic input switches are described in dcintro(1). Options specific to this program are:
-b|brief
Display a single line brief summary.
-filename
Show the name of the file supplied in the arguments; a hyphen will be reported if no filename was supplied.
ENVIRONMENT EXAMPLES
% dcfile dicomdir.
Meta: UID 1.2.840.10008.1.2.1
Meta: Description "Explicit VR Little Endian"
Meta: ByteOrder Little
Meta: VR Explicit
Meta: Encapsulated No
Data: UID 1.2.840.10008.1.2.1
Data: Description "Explicit VR Little Endian"
Data: ByteOrder Little
Data: VR Explicit
Data: Encapsulated No
% dcfile expmeta.dc3
Meta: UID 1.2.840.10008.1.2.1
Meta: Description "Explicit VR Little Endian"
Meta: ByteOrder Little
Meta: VR Explicit
Meta: Encapsulated No
Data: UID 1.2.840.10008.1.2
Data: Description "Implicit VR Little Endian"
Data: ByteOrder Little
Data: VR Implicit
Data: Encapsulated No
% dcfile NM.1
Data: UID 1.2.840.10008.1.2
Data: Description "Implicit VR Little Endian"
Data: ByteOrder Little
Data: VR Implicit
Data: Encapsulated No
% dcfile test.spi
Data: ByteOrder Big
Data: VR Implicit
Data: Encapsulated No
% dcfile -b evrlewm.dcm
DICOM file, with metaheader, Explicit VR Little Endian
% dcfile -b evrlenom.dcm
DICOM file, no metaheader, Explicit VR Little Endian
FILES SEE ALSO file(1), dcdump(1), dcintro(1)AUTHOR
Copyright (C) 1993-2010. David A. Clunie DBA PixelMed Publishing. All rights reserved.
BUGS DICOM PS3 6 March 2007 DCFILE(1)