Hai all,
I need some help with java script. I am fairly new to js, so can you please help me out.
Here is my issue..
I am writing a java script where it need to check for some thing from a .txt file. i have a .txt file where it has the following data(P.S it has comma seperated values)
The file text is in this way...(I have saved as abc.txt)
A,B,C,D,E,F,G,H,I,J
1,ABC,XYZ,YOW-YVR,D,CXR11,Use this for this pair,1,2,3,4
2,ABC,XYZ,YVR-YYZ,D, --,No Message,1,2,3,4
3,ABC,XYZ,YUL-YYZ,D,CROC07,Use after this,1,2,3,4
4,ABC,XYZ,YYC-YYZ,D,CXR13,Use this for this pair2,1,2,3,4
5,ABC,XYZ,YOW-YYZ,D,CROC07,Use after this,1,2,3,4
6,ABC,XYZ,YHZ-YOW,D,CXR13,Use this for this pair3,1,2,3,4
7,ABC,XYZ,LHR-YYZ,I,CXR13,Use this for this pair4 ,1,2,3,4
8,ABC,XYZ,YEG-YYZ,D,CXR13,Use this for this pair5,1,2,3,4
9,ABC,XYZ,YEG-YOW,D,CXR13,Use this for this pair8,1,2,3,4
10,ABC,XYZ,YOW-YYC,D,CXR13,Use this for this pair3,1,2,3,4
So in the first line it has the description for each field. In the first line we have 10 fields A to J
From the second line we have the actual data in that. We have 10 fields from there too. I have almost 500 lines in this way.
as you can see all the fields(10) from the second line are in the same format and fields 2 and 3 (ABC,XYZ)are always same.
And the last 4 fields 1,2,3,4 may be same or different, but my requirement does not contain these fields.
In this what i need is, i give two values, lets say val1 and val2. So in this java script it should check for val1= first 3 letters from the field 3 in the txt file(abc.txt) i.e for the first line it is YOW and then check for val2= last 3 letters from field 3 from the txt file (abc.txt)i.e for the first line it is YVR.
If it satisfies then it should print the filed 6 i.e for the first line it is : Use this for this pair.
So in this java script it should check for all the lines in the text file for any possible combinations. And all the fields are seperated by commas, and the code should ommit checking for the first line, as it is not required.
Hope you understand my point,
please some one can help me.
I need some help with java script. I am fairly new to js, so can you please help me out.
Here is my issue..
I am writing a java script where it need to check for some thing from a .txt file. i have a .txt file where it has the following data(P.S it has comma seperated values)
The file text is in this way...(I have saved as abc.txt)
A,B,C,D,E,F,G,H,I,J
1,ABC,XYZ,YOW-YVR,D,CXR11,Use this for this pair,1,2,3,4
2,ABC,XYZ,YVR-YYZ,D, --,No Message,1,2,3,4
3,ABC,XYZ,YUL-YYZ,D,CROC07,Use after this,1,2,3,4
4,ABC,XYZ,YYC-YYZ,D,CXR13,Use this for this pair2,1,2,3,4
5,ABC,XYZ,YOW-YYZ,D,CROC07,Use after this,1,2,3,4
6,ABC,XYZ,YHZ-YOW,D,CXR13,Use this for this pair3,1,2,3,4
7,ABC,XYZ,LHR-YYZ,I,CXR13,Use this for this pair4 ,1,2,3,4
8,ABC,XYZ,YEG-YYZ,D,CXR13,Use this for this pair5,1,2,3,4
9,ABC,XYZ,YEG-YOW,D,CXR13,Use this for this pair8,1,2,3,4
10,ABC,XYZ,YOW-YYC,D,CXR13,Use this for this pair3,1,2,3,4
So in the first line it has the description for each field. In the first line we have 10 fields A to J
From the second line we have the actual data in that. We have 10 fields from there too. I have almost 500 lines in this way.
as you can see all the fields(10) from the second line are in the same format and fields 2 and 3 (ABC,XYZ)are always same.
And the last 4 fields 1,2,3,4 may be same or different, but my requirement does not contain these fields.
In this what i need is, i give two values, lets say val1 and val2. So in this java script it should check for val1= first 3 letters from the field 3 in the txt file(abc.txt) i.e for the first line it is YOW and then check for val2= last 3 letters from field 3 from the txt file (abc.txt)i.e for the first line it is YVR.
If it satisfies then it should print the filed 6 i.e for the first line it is : Use this for this pair.
So in this java script it should check for all the lines in the text file for any possible combinations. And all the fields are seperated by commas, and the code should ommit checking for the first line, as it is not required.
Hope you understand my point,
please some one can help me.