Computer Hope

Microsoft => Microsoft DOS => Topic started by: lalat06bag on February 09, 2018, 01:59:41 PM

Title: Need help - converting the files reading the content from a flat file
Post by: lalat06bag on February 09, 2018, 01:59:41 PM
Need help in converting the files reading the content from a flat file in a batch. New to the batch. Please see.

 Source folder would be having all the reports.
 xpdf would be containing pdftotxt.exe which would convert pdf to text file.
 Dest folder would be having the converted content.
 daily_report.txt would contain the pdf files which need to be converted.

 While source would be searched, it would pick all the files mentioned in the daily_report.txt with today's date, convert it and move it to the destination folder. So in the destination folder, there would not be the date part. It would be same in the flat file.txt.

 The files would be looked upon for 2 hours in every 5 mins till all the files are found or the time is reached. If not found, it would be written to the error log.
 Please note: there are few spaces in the file name.

 Source:

 XXXX_QRRPS Tran book - 0utgoing-en-in_2018-02-09T024757245Z.pdf
 XXXX_QRRPS Tran book - Incoming-en-in_2018-02-09T024757245Z.pdf
 XXXX_CB Vol By rce-en-in_2018-02-09T024757245Z.xlsx
 XXXX_ABC_Rec_Eng-en-eu_2018-02-09T024757245Z.pdf
 XXXX_ABC_Rec_Eng-en-eu_2018-02-09T024757245Z.xlsx
 XXXX_QRRPS Tran book - Incoming-en-in_2018-02-08T024757245Z.pdf
 XXXX_QRRPS Tran book - Incoming-en-in_2018-02-08T024757245Z.pdf
 XXXX_CB Vol By rce-en-in_2018-02-08T024757245Z.xlsx
 XXXX_ABC_Rec_Eng-en-eu_2018-02-08T024757245Z.pdf
 XXXX_ABC_Rec_Eng-en-eu_2018-02-08T024757245Z.xlsx

 daily_report.txt would be having
 XXXX_QRRPS Tran book - 0utgoing-en-in.pdf
 XXXX_ABC_Rec_Eng-en-eu.pdf

 dest folder would be having
 XXXX_QRRPS Tran book - 0utgoing-en-in.txt
 XXXX_ABC_Rec_Eng-en-eu.txt
Title: Re: Need help - converting the files reading the content from a flat file
Post by: Squashman on February 09, 2018, 05:55:01 PM
Why don't you at least attempt a solution considering all the help you have already gotten on DosTips.com
Title: Re: Need help - converting the files reading the content from a flat file
Post by: patio on February 09, 2018, 07:09:25 PM
 :P