Why you did not spent a couple minutes reviewing the facilities at this site before post your first question?cheeseng wrote:... as i cant attached a files here.. and copy and paste the source data will affect the format...
cheeseng wrote:.. for the processheader part, how about use this code?
echo User name,User text,Begin menu,Group jobs,End group jobs,Command ^ ine on menus,Attention-key program,Reference user, Group I, Group I Description,Group II, Group II Description,Group III, Group III Description, Group IV, Group IV Description,Group V, Group V Description,Group VI, Group VI Description>outputfile.csv
If refer to the first print-screen (1) that is the most basic output...
(yes, I think the same...)foxidrive wrote:... and I have no idea how screenshots are going to help in testing code...
You mean I am obliged to see that picture, otherwise I won't understand what your are talking about? Can't you explain here in a couple lines what the difference is?
Really?cheeseng wrote:... I will definitely be more careful in the future post ...
cheeseng wrote:... i am not aware such thing will trouble u guys so much..
I don't understand why you don't see that the minimum modification of the data lead to a modification in the program; this is true for any programming language and in general for any application. Do you think that is the same to enter a space that not do it? Is this your first contact with computers?
For instance, in the first example source file you included here with the tag code you added empty lines. Processing empty lines is particularly difficult in a Batch file, so I had to insert code to manage that case. However, the real source file (input2.txt, it is really that?) have NOT empty lines! Developing a Batch program like this one is not an easy task, so is very disappointing that many of my efforts were completely useless because details like this one (and the list is long!). I really feel that I have wasted my time trying to solve this problem.
Again and again... I have not Excell! It wouldn't be easier that you identify the changes in the posted text vs. the original data and describe they in a couple lines?cheeseng wrote:i have provided the input and desired output files to dropbox...
Of course, I don't know what your are talking about (I have not Excell). Can't you explain here in a couple lines the difference?cheeseng wrote:For the output in csv format can ignore rc code review1 review2 and remark.
cheeseng wrote:I didn't aware that you will use the datai put in the post... in case u wondering what i am talking about.. (Kindly don't use this, as this is for illustration purpose only...)
I REALLY don't understand what the purpose is to post example data that is not the real data: "... don't use this, as this is for illustration purpose only"? Illustration purpose only??? What do you think this forum is for???? Couldn't you spend 5 minutes describing how to recover the real data from the posted text? Couldn't you post in the other site a small example data file from the very beginning?
cheeseng wrote:However, this time would you like to use source file i put in dropbox.
You act like if we all were your employees! (where is my money?)
Really? Are you sure it is not 97% nor 99%? It wouldn't be easier if you just describe what exactly happened in a couple lines?cheeseng wrote:... the code work 98%
Of course, I have absolutely no idea what you are talking about, but I suppose you are trying to fix the 2% bad part of my program. It is (still) funny to me that you wrote this: "the raw data > filter off > become the input" and did not realize that what you called "filter off" was the posting of the data in this forum. This way, to fix this problem you should identify HOW the original data is modified when is posted in this site and then ask: "How I should modify the program to manage this modification in the data?".cheeseng wrote:... i am now working on try to filter off the content to reach what @Aacini has offered previously..
i am thinking to work in 2 step.. first with the raw data > filter off > become the input what Aacini has done > then run the code > output.
i try to use findstr /B "content"Code: Select all
type %1 | findstr /B " **** " | findstr /B "Begin menu" | findstr /B "Group jobs" | findstr /B "End group jobs" | findstr /B "Command line on menus" | findstr /B "Reference user"> output.txt
but doesn't work..
any guide?
I had fixed the program to get the expected output when processing input2.txt as source file (is it the real data format? perhaps we never know...). This is the result of the first 6 output records:
Code: Select all
UserName,User Text,Begin Menu,Group Jobs,End Group Jobs,Command Line on Menus,Attention-Key Program,Reference user,Group I,Group I Description,Group II,Group II Description,Group III,Group III Description,Group IV,Group IV Description,Group V,Group V Description,Group VI,Group VI Description
ABAX,Beatrice Raffaele,*NONE, 15,*NO,*NO,*ACTIVE,OPERATOR
ABCG,Barchiesi Giancarlo,*NONE, 15,*NO,*NO,*ACTIVE,OPERATOR
ABEF,Fabio Besomi - IBM System Engineer,*NONE, 15,*NO,*NO,*ACTIVE,OPERATOR
ABTQ,GIULIA BERTON,*NONE, 15,*NO,*NO,*ACTIVE,OPERATOR
ACAG,Cavalli Graziano,*NONE, 15,*NO,*NO,*ACTIVE,OPERATOR
ACEA,Carretta Mauro,*NONE, 15,*NO,*NO,*ACTIVE,OPERATOR
However, for illustration purposes only, I will not post the new version here. The modification to the program is really simple; you just need to change 1 (one) character to get the desired output! So this time I will let you to discover by yourself what the required modification is. Just remember what I said above about the change of the real data when you post it here. (Perhaps if you explain that change, someone could find the required modification for you.)
In my version I also deleted the part that process empty lines (the program will run somewhat faster without them) and include a counter that is displayed in the screen for every record processed (because the whole process takes too long...).
An additional modification (a While loop) may speed up the program via a much faster processing of the large blocks of unrelated data ("*REFUSER" lines).
Regards...
Antonio