My system is generating two files every 15 minutes and file names are given automatically as below. (98,99,89,90 are the sequence numbers)
I want to combine these files and generate only one file in every one hour as below.
How can i achieve this?
Last edited by Franklin52; 09-25-2013 at 03:45 AM..
Reason: Please use code tags
Try this... Test it first and then try on actual files...
This will not delete the files, if you do want to delete it, append the rm command to the print statement.
That script didnt combine the files. This created seperate files by hourly based.
I prefer to combine "15 minutes generated two different files" "hourly in one file"
Just adding my 2 cents here.
Say you have the files a1.txt, b1.txt, c1.txt, d1.txt.
How about you try writing a script that performs the following operations:
1) Create a new file, say 1 and append the contents of each file into it:
2) Leave the 1 file intact and delete the other files:
(or you can move them to a different directory)
Repeat the process for as long as you need, creating files with .txt extension every 15 minutes, then combining them into a file without extension, and then deleting the .txt files.
Hope it helps.
Try
If files come in regularly, and you run this regularly, you'll need to either remove the quarter hourly files after catting, or make the j for loop somewhat more specific.
Hello Unix gurus,
I have a large number of files (say X) each containing two columns of data and the same number of rows.
I would like to combine these files to create a unique merged file containing X columns corresponding to the second column of each file (with a bonus of having the first... (3 Replies)
Hello All,
I have several column files like this
$cat a_b_s1.xls
1wert
2tg
3asd
4asdf
5asdf
$cat c_d_s2.xls
1wert
2tg
3asd
4asdf
5asdf
desired put put
$cat combined.txt
s1 s2 (2 Replies)
I'm trying to combine colums from multiple file to a single file but having some issues, appreciate your help.
The filenames are the same except for the extension,
path1.m0
---------
a b c
d e f
g h i
path1.m1
---------
m n o
p q r
s t u
File names are path1.m
The... (3 Replies)
Good morning. I have a piece of code that is currently taking multiple files and using the CAT.exe command to combine into one file that is then sorted in reverse order based on the 3rd field of the file, then displayed on screen. I am trying to change this so that the files are being combined into... (4 Replies)
dear all,
pls help on this script..
i have many files which will be created every mins in particular directory.
i want to grep a particular string from only for unique hour files.
from the below code i want to grep a string from only 9th hour files .
Ex files:
-rw-r--r-- 1 root ... (5 Replies)
Hi everybody.
I have a number of files that i would like to combine. however not concatenating, but rather extract lines from the files.
Example:
File1 ------ File2 ------File3 ...
line11 ---- line21 ---- line31 ...
line12 ---- line22 ---- line32 ...
line13 ... (3 Replies)
I'm new to shell scripting... i have been given a task.. can any one help in this regard....
1) Check hourly for files in <destination-path><destination-file-template><destination-file-suffix> for files older than <destination-file-retention> days and purge. It should then check... (1 Reply)
Hello,
I am attempting to combine two files where the second file can have more than one match with the lookup field (node) in the first file, onto one line of the output file. Also alerting if a lookup was not found in file2
=-=-=-=-=-=-=
Example of file1
node,type
=-=-=-=-=-=-=
bob,232... (5 Replies)