[Za...] Posted December 18, 2023 Share Posted December 18, 2023 Hello all, As a customer request, We need to get a .txt report that includes header and characteristics combined. As seen below, We are getting two separated reports .hdr and .chr. Is there any way to combine them? Link to comment Share on other sites More sharing options...
[Er...] Posted December 18, 2023 Share Posted December 18, 2023 Well, it's almost christmas so lets be helpful...There are a million different ways, one way, (not unlikely a solution thet I would use my self if I had to do this) is to let a batch file do it. Content of batch-file: type *.hdr >merge.txt & echo. >>merge.txt type *.chr >>merge.txt Just remebered that you dont need the for command.... 😃 Link to comment Share on other sites More sharing options...
[Za...] Posted December 18, 2023 Author Share Posted December 18, 2023 Please sign in to view this quote. Wish you all happy christmas! I simply have no idea where to paste these codes. Could you help me with the details please? Link to comment Share on other sites More sharing options...
[Er...] Posted December 18, 2023 Share Posted December 18, 2023 Create a textfile, paste the content, change the file ending from ".txt" to ".bat" or ".cmd". Place it in the same foler as your chr and hdr files and run it. (I would how ever encourage you to google the function of it, before you execute it, so that you know what it does. Don't run code you don't understand, is a good general rule) Link to comment Share on other sites More sharing options...
[Za...] Posted December 18, 2023 Author Share Posted December 18, 2023 I got it. But my question is, is there any way to get one txt report that includes header and characteristics? Link to comment Share on other sites More sharing options...
[Cl...] Posted December 18, 2023 Share Posted December 18, 2023 A report that looks like this? If so: Resources > Design custom report > Report header compact report > protform > default_compr_refer. Resources > Define report > Compact report > All characteristics. Measurement tab > Multiple report drop-down > Default compact report > Format drop-down > default_compr_refer. Range drop-down > All characteristics. Link to comment Share on other sites More sharing options...
[Za...] Posted December 18, 2023 Author Share Posted December 18, 2023 Here is an example template that I am trying to do like this below.Template_1.png Link to comment Share on other sites More sharing options...
[Cl...] Posted December 18, 2023 Share Posted December 18, 2023 Ok, I misunderstood what exactly you were looking for. Link to comment Share on other sites More sharing options...
[Za...] Posted December 22, 2023 Author Share Posted December 22, 2023 I guess there is no way to combine these 2 reports. Link to comment Share on other sites More sharing options...
[Mi...] Posted December 22, 2023 Share Posted December 22, 2023 Hello Zafer, why don't you use the method Eric proposed? You can automate the process by creating a batch-file called "report_end.bat" in the dictionary of your inspection with Eric's code. For Instance, if your hdr- and chr-file are created in the folder C:\Temp\ and you also want to output the merged file in the folder, the modified code is as follows: type C:\Temp\*.hdr >"C:\Temp\merge.txt" & echo. >>"C:\Temp\merge.txt" type C:\Temp\*.chr >>"C:\Temp\merge.txt" del "C:\Temp\*.hdr" del "C:\Temp\*.chr" The del-command deletes the hdr- and chr-file afterwards.Unbenannt.JPG Link to comment Share on other sites More sharing options...
[Za...] Posted January 10 Author Share Posted January 10 Thank you! But the problem is, both of my files are .txt. They are like: 132131_hdr.txt 132131_chr.txt. File types are txt, so i could not find a command that works. Link to comment Share on other sites More sharing options...
[Ma...] Posted January 10 Share Posted January 10 As far as i tried you would need to download "findstr" to be able to further search. We use LUA for some qdas editing. If you are ok with using LUA, then i can make a script for you - tomorrow Link to comment Share on other sites More sharing options...
[An...] Posted January 10 Share Posted January 10 I believe the issue is a typo based on a misleading description & screenshot Screenshot and description shows .hdr and .chr Recent reply spells out they all end in .txt Please sign in to view this quote. Please sign in to view this quote. Please sign in to view this quote. This needs to change to make the original solution work: *.hdr → *_hdr.txt *.chr → *_chr.txt The following combines ALL files ending in _hdr.txt and _chr.txt into a new file called merge.txt :: combine-hdr-chr.cmd TYPE *_hdr.txt > merge.txt TYPE *_chr.txt >> merge.txt In case you need to separate out individual part reports... here's a more interactive version: :: interactive-combine-hdr-chr.cmd @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION :: Ask for source file name ECHO Example part file name: ECHO file1_hdr.txt ECHO ^^^^^^^^^^ SET /P partname="Enter the name of the part files: " :: Ask for combined file name SET /P filename="Enter the name of the combined file: " :: Combine files to entered file name, .txt appended TYPE "%partname%_hdr.txt" > "%filename%.txt" TYPE "%partname%_chr.txt" >> "%filename%.txt" ENDLOCAL EXIT Will likely need to https://support.microsoft.com/en-us/windows/common-file-name-extensions-in-windows-da4a4430-8e76-89c5-59f7-1cdbbc75cb01 to save and rename the attached .txt files as .cmd – wise forum rules don't allow .cmd attachmentscombine-hdr-chr.txtinteractive-combine-hdr-chr.txt Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in