LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Linux code related query (https://www.linuxquestions.org/questions/linux-newbie-8/linux-code-related-query-4175609162/)

TimeToAsk 07-04-2017 01:02 PM

Linux code related query
 
I have to write a code where I have the below files in a directory
To every corresponding A1(an output file format say pdf),there should be a file P1(Customer information File).Now,I need to process these files for a scenario where the below is present

A1,A2,A3

P1,P3,P4

Here P2 and A4 are missing.

All of the above are in the same directory and need to processed(as in moved to another processing directory and your code should then use the files to create a final file using the above information)

I want the code to check and pick only file combinations and leave rest unwanted files.Say: A1,P1 and A3,P3 should be picked and processed and rest all should be thrown as an error.

How can I achieve that

TB0ne 07-04-2017 01:16 PM

Quote:

Originally Posted by TimeToAsk (Post 5730516)
I have to write a code where I have the below files in a directory
To every corresponding A1(an output file format say pdf),there should be a file P1(Customer information File).Now,I need to process these files for a scenario where the below is present

A1,A2,A3

P1,P3,P4

Here P2 and A4 are missing.

All of the above are in the same directory and need to processed(as in moved to another processing directory and your code should then use the files to create a final file using the above information) I want the code to check and pick only file combinations and leave rest unwanted files.Say: A1,P1 and A3,P3 should be picked and processed and rest all should be thrown as an error.

How can I achieve that

Lots of ways; however, you first need to read the "Question Guidelines" link in my posting signature. You need to provide details (such as version/distro of Linux), as well as what language you want to write this in. The tools/options available vary by language, and what's good for bash may not be best for perl, python, or other languages.

And we are happy to help you, but you are going to have to post what *you* have written/done/tried on your own first. We will not write your scripts/programs for you.

rtmistler 07-04-2017 04:10 PM

Quote:

Originally Posted by TimeToAsk (Post 5730516)
I have to write a code where I have the below files in a directory
To every corresponding A1(an output file format say pdf),there should be a file P1(Customer information File).Now,I need to process these files for a scenario where the below is present

A1,A2,A3

P1,P3,P4

Here P2 and A4 are missing.

All of the above are in the same directory and need to processed(as in moved to another processing directory and your code should then use the files to create a final file using the above information)

I want the code to check and pick only file combinations and leave rest unwanted files.Say: A1,P1 and A3,P3 should be picked and processed and rest all should be thrown as an error.

How can I achieve that

Hi TimeToAsk and welcome to LQ.

This appears an awful lot like an assignment or homework question.

As TB0ne points out, we are happy to help, but we will not write your programs for you. What language are you planning to use for this project?


All times are GMT -5. The time now is 01:53 AM.