04-28-2011
The trailer does have a count of the records.
---------- Post updated at 01:00 PM ---------- Previous update was at 12:50 PM ----------
Thanks for all the replies....
first problem is to identify that which one is file created earlier and which one later. It could be file1 and file2 or file6 and file7....so on. I am writting this in a shell script. FILE_NAME=`echo File*` will give me
FILE_NAME=File1 File2.
I want to get it in seperate variable as below.
example:
FILE_NAME1=File1
FILE_NAME2=File2
so that i can use the logic suggested by all of you.
Last edited by Deepak62828r; 04-28-2011 at 03:02 PM..
Reason: If at a time there are two files File1 and File2. File2 is the latest one
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
...
i have 4 files to concatenate but in a certain order and i wanted to do it in a shorter one line command , if possible !
4 files : file , file0 , file1 and file2
file1 into file2
file0 into the result
file into the result
thanks in advance
Christian (1 Reply)
Discussion started by: Nicol
1 Replies
2. UNIX for Dummies Questions & Answers
I'm trying to concatenate records from 2 files and output it to a third file. The problem I'm running into is that it seems like the "While" command is limited to processing one file at a time. It seems like you could read a record from file1 into a variable. Then do the same for the for file2.... (4 Replies)
Discussion started by: Powcmptr
4 Replies
3. Shell Programming and Scripting
HI
I need to concatenate two files which are having headers. the result file should contain only the header from first file only and the header in second file have to be skipped.
file1:
name age
sriram 23
file2
name age
prabu 25
result file should be
name age
sriram 23
prabu ... (6 Replies)
Discussion started by: Sriramprabu
6 Replies
4. Shell Programming and Scripting
hi all,
I have a requirement where in i have to read all the filenames based on a pattern from a directory and concatenate all these file names and write it to another file.
i am using the following code to do this
var1=''
for filename in $_DIR/${FILE_NAME}*
do
if
if
then... (7 Replies)
Discussion started by: nvuradi
7 Replies
5. UNIX for Dummies Questions & Answers
Need a Unix command to save the last 20 versions of a file in a specific directory and delete everything else. Date is irrelevant. Anyone aware of such an animal?
In my test, I came up with:
ls -t1 /tmp/testfile* | tail -n +20 | xargs rm
I don’t quite trust the author though! (1 Reply)
Discussion started by: rwsherman
1 Replies
6. Shell Programming and Scripting
Hi
I have one directory whose name i don't remember exactly only starting letter i know which is Resp.
Can you please let me know the command to find the similar directory in the root.
Rajesh (3 Replies)
Discussion started by: guddu_12
3 Replies
7. Shell Programming and Scripting
Hi,
I have a unix file with the below structure -
CustId1 CustName1 CustPhn1 /u/home/xmldata/A000001
CustId2 CustName2 CustPhn2 /u/home/xmldata/A000002
CustId3 CustName3 CustPhn3 /u/home/xmldata/A000003
Then I have another unix directory /u/home/xmldata
This directory has... (3 Replies)
Discussion started by: Simanto
3 Replies
8. Shell Programming and Scripting
Hi,
I have file in my $datadir as below :-
SAT_1.txt
SAT_2.txt
BAT_UD.lst
BAT_DD1.lst
DUTT_1.txt
DUTT_la.txt
Expected result :-
should get all the above file in $<Filename>_file.lst
Below is my code :-
for i in SAT BAT DUTT
do
touch a.lst
cd $datadir (1 Reply)
Discussion started by: satishmallidi
1 Replies
9. Shell Programming and Scripting
So, I have a directory tree that has many files named thusly:
X_REVY.PDF
I need to find any files that have the same X portion (which can be nearly anything) as any another file (in any directory) but have different Y portions (which can be any number from 1-99).
I then need it to return... (3 Replies)
Discussion started by: Kamezero
3 Replies
10. Shell Programming and Scripting
Hello,
I need to move all the files inside /XYZ (has multi-depth sub directories) that are older than 14 days to/ABC directory but with retaining the SAME directory structure.
for example:
/XYZ/1/2/3/A/b.txt should be moved as /ABC/1/2/3/A/b.txt
I know about find /XYZ -type f -mtime +14... (3 Replies)
Discussion started by: prvnrk
3 Replies
LEARN ABOUT CENTOS
gvfs-ls
GVFS-LS(1) User Commands GVFS-LS(1)
NAME
gvfs-ls - List files
SYNOPSIS
gvfs-ls [OPTION...] [LOCATION...]
DESCRIPTION
gvfs-ls lists information about the given locations. If no location is given, it defaults to the current directory.
gvfs-ls is similar to the traditional ls utility, but using gvfs locations instead of local files: for example you can use something like
smb://server/resource/file.txt as location.
File attributes can be specified with their gvfs name, e.g. standard::icon, or just by namespace, e.g. unix, or by '*' which matches all
attributes. Several attributes or groups can be specified, separated by comma.
OPTIONS
The following options are understood:
-?, --help
Prints a short help text and exits.
-a, --attributes=ATTRIBUTES
The attributes to get, specified as a comma-separated list of gvfs file attribute names.
-h, --hidden
Show hidden files.
-l, --long
Use a long listing format.
-c, --show-completions=PREFIX
Show only filenames starting with PREFIX.
-n, --nofollow-symlinks
Don't follow symlinks.
EXIT STATUS
On success 0 is returned, a non-zero failure code otherwise.
SEE ALSO
ls(1), gvfs-info(1)
gvfs GVFS-LS(1)