How to freely select one column based on another column data?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: How to freely select one column based on another column data?

#16 Post by Squashman » 28 Jun 2018 16:48

goodywp wrote:
28 Jun 2018 15:26
Tried another input file and works and could be the input file issue....really strange... nothing related to code...
I cannot think of any instance where the input file would cause the delims option to fail. The delims option is validated before the file is read and it wouldn't randomly work and not work like you are describing.

Aacini
Expert
Posts: 1885
Joined: 06 Dec 2011 22:15
Location: México City, México
Contact:

Re: How to freely select one column based on another column data?

#17 Post by Aacini » 29 Jun 2018 10:56

goodywp wrote:
28 Jun 2018 13:25
I had some issue for this code. It was OK when the column is not that much. But now after adding more column and getting some weird issue, for some column I got the error back again

Here is my config file

MOCKUP_DL QA_DL US_PROD_DL TD_DL GPC_DL ELAVON_DL DESJAR_DL CA_PROD_DL

. . . . .

my source column is QA_DL then target TD_DL, it works fine but
when I select source column is QA_DL then target CA_PROD_DL I got an error as

. . . . .

But when I switch two column name between TD_DL and CAN_PROD_DL then try the above code again,
got the same result that means TD_DL works but CAN_PROD_DL not work and also got that error message after line bb

what is the issue here??? It looks like not making sense to me it is name of head dependent... :oops:
Thanks
Are you giving CA_PROD_DL or CAN_PROD_DL? The second one does not exists in the file...

I suggest you to insert the following line before the last FOR line:

Code: Select all

if not defined token echo ERROR: This profname does not exists: "%profname%" & goto :EOF
Antonio

goodywp
Posts: 250
Joined: 31 Jul 2017 09:57

Re: How to freely select one column based on another column data?

#18 Post by goodywp » 12 Jul 2018 08:34

Aacini wrote:
29 Jun 2018 10:56
goodywp wrote:
28 Jun 2018 13:25
I had some issue for this code. It was OK when the column is not that much. But now after adding more column and getting some weird issue, for some column I got the error back again

Here is my config file

MOCKUP_DL QA_DL US_PROD_DL TD_DL GPC_DL ELAVON_DL DESJAR_DL CA_PROD_DL

. . . . .

my source column is QA_DL then target TD_DL, it works fine but
when I select source column is QA_DL then target CA_PROD_DL I got an error as

. . . . .

But when I switch two column name between TD_DL and CAN_PROD_DL then try the above code again,
got the same result that means TD_DL works but CAN_PROD_DL not work and also got that error message after line bb

what is the issue here??? It looks like not making sense to me it is name of head dependent... :oops:
Thanks
Are you giving CA_PROD_DL or CAN_PROD_DL? The second one does not exists in the file...

I suggest you to insert the following line before the last FOR line:

Code: Select all

if not defined token echo ERROR: This profname does not exists: "%profname%" & goto :EOF
Antonio
Thanks Antonio. You are so truth and have a sharp eyes....
Sure I shall add this line to detect if the profname exist or not...
:D

Post Reply