![]() |
| ||
| Concat files with similar names in different directories Dear Experts, to give a better picture i will explain the directory structure first the files have the same naming convention and the only difference is the first letters which is the title of that account, there is a total of 210 files only the bold letters change for each file exe: file 1, /Data/KG-02/ACT/KG-02-PEF-RHOX-NOR.dat file 2 /Data/KG-64/ACT/KG-64-PEF-RHOX-NOR.dat +>Data -----> /KG-02 -------->/ACT/ -------->KG-02-PEF-RHOX-NOR.dat i have to concatinate these file with all the other files of similar name in the different directories, so i can have one account summary. id appreciate any help |
| ||
| Re: Concat files with similar names in different directories for i in Data/KG-*;do cat "$i"/ACT/*dat>"${i##*/}.dat";done |
| ||
| Re: Concat files with similar names in different directories thanks, but i got an error message declaring illegal variable name Quote:
|
| ||
| Re: Concat files with similar names in different directories You're using a very old shell, try with a different one: bash, ksh, zsh (for example, do not use /usr/bin/sh on Solaris). |
| ||
| Re: Concat files with similar names in different directories Works Perfectly ,, Thanks |
| All times are GMT -4. The time now is 10:33 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC