Recursive file processing from a path and printing output in a file
Hi All,
The script below read the path and searches for the directories/subdirectories and for the files. If files are found in the sub directories then read the content of the all files and put the content in csv(comma delimted) format and the call the write to xml function to write the
std xml format in the outputfile.
now, the problem is, script read the directories/sub directories and file contents at one level but it's not searching recursively.
Explain you with example :
path : C:\test has dirA and this dirA has sub dirB and sub dirC and these 2 sub directories has 2 files each. now script should search for files
and reads 2 files from sub directories DirB and pass the content of the file and print the xml in result file. after that it need read sub dirC
files and pass the content to xml str and print/append them in the same resultfile.
Last edited by Franklin52; 12-10-2012 at 05:44 AM..
Reason: fixed code tags
I'm developing a generic script to catenate all files found in a given directory.
The problem I've got is that the depth of the given directory is unknown, so I end up with some catenated directories. My unix isn't that hot and I'm at a loss.
Heres an extract from the script
cd $1
for i in... (4 Replies)
Hi,
I am trying to do the following using AWK program.
1. Read the input data file
2. Parse the record and see if it contains errors
3. If the record contains errors, then write it into Reject file, else, write into usual output file or display it on the screen
Here is what I have done -... (6 Replies)
Hi.
I am new to scripting and could really do with some advice on the best way to put a script together. Here is the scenario I am working to;
- i will get files via ftp to a tmp directory on the server
- all files will have a unique file name but with the same extension (.USM)
- for each... (5 Replies)
I want to print the output of a db2 query, on to an unix file in a manner that the columns are separated by 'commas'. Please help me out..thanx in advance (1 Reply)
Hi ALL,
I am presently using perl script mukesh.pl I just want to catch its output into another text file .
So I am using > File.txt .
I am getting output but i want the whole processing of the script into that file please let me know .
Thanks in advance
Cheers
Mukesh (1 Reply)
I have one input file ABC.txt and one output DEF.txt. After the ABC is processed and created output, I want to rename ABC.txt to ABC.orig and DEF to ABC.txt. Currently when I am doing this, it does not process the input file as it cannot read and write to the same file. How can I achieve this?
... (12 Replies)
Hi,
I need help in printing data in below format from file extensions with .dml, i have listed details below
file name is test_temp.dml, location in /home/users/test01/test_temp.dml
file content:
sample_type=
record
decimal(",") test_type;
date("DD-MM-YYYY")(",") test_date... (2 Replies)
Hi,
below 'awk' code was given for my thread 'Help with printing output format from a file ' earlier, however script is not resulting expected output with below file content.
cat test_tes123.dml
record
string("\001") emp_num; /* CHAR(11) NOT NULL*/
date("YYYYMMDD")... (1 Reply)
I am having a bash script which is basically invoking a python program to validate the Source Query results against the target query results. I am placing all the queries in a .sql file.
I want to write to a Error log file incase if the syntax is wrong or if the column is not present in the... (4 Replies)
Hello Everyone,
I am new to Unix and trying to learn as much as I can. But I do not need to create urgent scripts that I can use instantly. :(:(
One of the scripts I am trying to write is essentially something that takes in a .txt file with product names.
The product names are... (3 Replies)