Sponsored Content
Top Forums Shell Programming and Scripting Insert file names when concatenate files into a file Post 302323201 by samky2005 on Friday 5th of June 2009 06:07:53 PM
Old 06-05-2009
Quote:
Originally Posted by Franklin52
You can use a loop like this:

Code:
for i in test_*; do echo Filename : "$i";echo;cat "$i"; done > bigfile


Thank you so much!
It worked.Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Concatenate files to one file with naming convention

Hi , i have below files in wrk folder. file names are 1102090001.CLT 1102090003.CLT 1102100019.CLT 1102100020.CLT the above files are concatenate to one file but that concatenate file name must be same naming convention. (date +%y%m%d)and 0001 count. example : concatenate file... (9 Replies)
Discussion started by: krbala1985
9 Replies

2. Shell Programming and Scripting

How to split a data file into separate files with the file names depending upon a column's value?

Hi, I have a data file xyz.dat similar to the one given below, 2345|98|809||x|969|0 2345|98|809||y|0|537 2345|97|809||x|544|0 2345|97|809||y|0|651 9685|98|809||x|321|0 9685|98|809||y|0|357 9685|98|709||x|687|0 9685|98|709||y|0|234 2315|98|809||x|564|0 2315|98|809||y|0|537... (2 Replies)
Discussion started by: nithins007
2 Replies

3. Shell Programming and Scripting

awk to insert a files names

I have a couple of text files which are named as 1.txt 2.txt 1000.txt 11.txt I want to cat/merge the contents of each text file into one single file like this 1 content of 1.txt 2 content of 2.txt 1000 content of 1000.txt 11 content of 11.txt (2 Replies)
Discussion started by: Lucky Ali
2 Replies

4. Shell Programming and Scripting

Concatenate many files which contents the same date as part of name file

Gents, I have lot of files in a folder where each file name includes the date of generation, then I would like to merge all the files for each date in a complete file. list of files in forder. dsd01_121104.txt dsd01_121105.txt dsd01_121106.txt dsd03_121104.txt dsd03_121105.txt... (7 Replies)
Discussion started by: jiam912
7 Replies

5. UNIX for Dummies Questions & Answers

Delete files whose file names are listed in a .txt file

hi, I need a help. I used this command to list all the log files which are for more than 10 days to a text file. find /usr/script_test -type f -mtime +10>>/usr/ftprm.txt I want all these files listed in the ftprm.txt to be ftp in another machine and then rm the files. Anyone can help me... (8 Replies)
Discussion started by: kamaldev
8 Replies

6. Shell Programming and Scripting

How to concatenate the files based upon the file name?

Hi Experts, I am trying to merge multiple files into one file based upon the file name. Testreport_Server1.txt ============ MonitoringReport_Server1.txt============ CentralReport_Server1 Here two files containing server1 should be merged into one file? How can i do... (16 Replies)
Discussion started by: sharsour
16 Replies

7. Shell Programming and Scripting

Exclude certain file names while selectingData files coming in different names in a file name called

Data files coming in different names in a file name called process.txt. 1. shipments_yyyymmdd.gz 2 Order_yyyymmdd.gz 3. Invoice_yyyymmdd.gz 4. globalorder_yyyymmdd.gz The process needs to discard all the below files and only process two of the 4 file names available ... (1 Reply)
Discussion started by: dsravanam
1 Replies

8. Shell Programming and Scripting

While loop a file containing list of file names until the files are found?

Hi, I have a control file which will contain all filenames(300) files. Loop through all the file names in the control files and check the existence of this file in another directory(same server). I need to infinitely(2 hrs) run this while loop until all the files are found. Once a file is found,... (5 Replies)
Discussion started by: laknar
5 Replies

9. Shell Programming and Scripting

Delete files except the file names available in the Except File

Hi, I need some help in the below scenario. I need to delete all the files from the directory except the file name available in the Except file. Like the folder ABC have files like A1.txt,A2.txt......A10.txt and also have a file named Except.txt with the content A3.txt,A4.txt Need a... (6 Replies)
Discussion started by: kban
6 Replies

10. Shell Programming and Scripting

Concatenate files based on names

Dear all, I have a list of files and I woulk like to concatenate some of them based on their name. Basically my files are names like that: file1_abcd_other_useless_letters_1_C1.txt file1_abcd_other_useless_letters_1_C2.txt file1_xywz_other_useless_letters_1_C1.txt... (4 Replies)
Discussion started by: giuliangiuseppe
4 Replies
STRACAT(3pub)						       C Programmer's Manual						     STRACAT(3pub)

NAME
stracat - concatenate many strings into an allocated memory block SYNOPSIS
#include <publib.h> char *stracat(const char *s, ...); DESCRIPTION
stracat will allocate a block of memory with malloc and concatenate all arguments strings into this block. The user is supposed to free the returned block. The end of the argument list is signalled by a null pointer. RETURN VALUE
stracat returns a pointer to the allocated block, or NULL if it could not be allocated. EXAMPLE
To concatenate "hello, " and "world", one might say the following. p = stracat("hello, ", "world", (char *)NULL); if (p != NULL) puts(p); Please note that it is necessary to case NULL as in the example above, since there is no information about the type of the argument available in the prototype, and since an unadorned NULL might not be of the correct type. (See any good C reference book or the comp.lang.c FAQ for more information.) SEE ALSO
publib(3), strcat(3) AUTHOR
Lars Wirzenius (lars.wirzenius@helsinki.fi) Publib C Programmer's Manual STRACAT(3pub)
All times are GMT -4. The time now is 12:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy