Oh, could we have just used this with cat in the first place? It's kinda like how I did it in the end, isn't it?
Yes and no: yes, in principle you could have done that. But you said you wanted to sort the files first, which is why i came up with the idea of the intermediate file, in which you could have sorted.
Still, alisters idea of guessing the filenames from a pattern was way better than mine, because it required a lot less handwork and still lead to the same result. Why it didn't work for you is still a mystery for me, i tried his solution with a dummy fileset and it worked well under Ubuntu 10, Fedora 13 and AIX 5.3. I have no MacOS to try it there, though, but from what i know this should make no difference.
Quote:
I learned what the gods really appreciate, from Homer.
Well said! I did the same, threw in some Epicurus for good measure and it didn't make me exactly unhappy.
I enjoyed the thread tremenduously, so thanks for asking questions and staying interested to the end. Whenever you want something to know we will be here to help again.
Why it didn't work for you is still a mystery for me.
I think it had to do with the whitespaces in the directories and filenames. Since that has been fixed, when I get a chance, I will give Alister's script, (and maybe the other's as well), another go. I will let you all know the results.
I also want to mention how incredibly useful find has turned out to be. Thanks for that one!
- Concatenate files and delete source files. Also have to add a comment.
- I need to concatenate 3 files which have the same characters in the beginning and have to remove those files and add a comment and the end.
Example:
cat REJ_FILE_ABC.txt REJ_FILE_XYZ.txt REJ_FILE_PQR.txt >... (0 Replies)
Hi
I am trying to learn linux step by step an i am wondering
can i use cat command for concatenate files but i want to place context of file1 to a specific position in file2 place of file 2 and not at the end as it dose on default?
Thank you. (3 Replies)
Hi All,
Need your help.
I will need to concatenate around 100 files but each end of the file I will need to insert my name DIRT1228 on each of the file and before the next file is added and arrived with just one file for all the 100files.
Appreciate your time.
Dirt (6 Replies)
I have a file named "file1" which has the following data
10000
20000
30000
And I have a file named "file2" which has the following data
ABC
DEF
XYZ
My output should be
10000ABC
20000DEF (3 Replies)
Hi, I want to create a batch(bash) file to combine 23 files together. These files have the same extension. I want the final file is save to a given folder. Once it is done it will delete the 23 files.
Thanks for help. Need script. (6 Replies)
I have directory structure sales_only under which i have multiple directories for each dealer
example:
../../../Sales_Only/xxx_Dealer
../../../Sales_Only/yyy_Dealer
../../../Sales_Only/zzz_Dealer
Every day i have one file produce under each directory when the process runs.
The requirement... (3 Replies)
I have 2 files
FILEA
1232342
1232342
2344767
4576823
2325642
FILEB
3472328
2347248
1237123
1232344
8787890
I want the output to go into a 3rd file and look like:
FILEC
1232342 3472328 (1 Reply)
I need a script to concatenate several files in one step, I have 3 header files say file.S, file.X and file.R, I need to concatenate these 3 header files to data files, say file1.S, file1.R, file1.X so that the header file "file.S" will be concatenated to all data files with .S extentions and so on... (3 Replies)
Hi, I'm totally new to Unix. I'm an MVS mainframer but ran into a situation where a Unix server I have available will help me. I want to be able to remotely connect to another server using FTP, login and MGET all files from it's root or home directory, logout, then login as a different user and do... (1 Reply)
Hi there,
I have numerous files in a directory (approx 2500) that I want to delete although I get the following:-
Server> rm *.*
Arguments too long
Is there a proper way of deleting this rather than breaking it down further through the list of files
rm *10.*
rm *11.*
rm *12.*
... (10 Replies)