| | |
Concat files with similar names in different directories
![]() |
•
•
Join Date: Jun 2007
Posts: 7
Reputation:
Solved Threads: 0
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
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
Shell Scripting Syntax (Toggle Plain Text)
for i in Data/KG-*;do cat "$i"/ACT/*dat>"${i##*/}.dat";done
•
•
Join Date: Jun 2007
Posts: 7
Reputation:
Solved Threads: 0
thanks, but i got an error message declaring illegal variable name
•
•
•
•
Shell Scripting Syntax (Toggle Plain Text)
for i in Data/KG-*;do cat "$i"/ACT/*dat>"${i##*/}.dat";done
![]() |
Similar Threads
- another newbie with alot of redhat and apache server Q'S (Linux Servers and Apache)
- Visual c++ libraries (C++)
- Trouble opening certain files... (Windows 95 / 98 / Me)
- server (*nix Software)
Other Threads in the Shell Scripting Forum
- Previous Thread: shell script
- Next Thread: Reading through lines of text file sequencially
| Thread Tools | Search this Thread |





