myspacee Posted May 6, 2009 Posted May 6, 2009 hello to all, try to understand how find differences between 2 attached text files: both are create from a procedure, but sometime @LF is correct, sometime is identified as a small square. Try _FileCountLines, stinginstr, without luck. If you open files with notepad you can see differences, but can't script a way to find differences. Anyone can solve this mistery? Thank you, m.
Xenobiologist Posted May 6, 2009 Posted May 6, 2009 What do you want to do? Find the diffs and then? Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
myspacee Posted May 6, 2009 Author Posted May 6, 2009 I need this list to copy, move, rename lot of files. m.
water Posted May 6, 2009 Posted May 6, 2009 The difference is that file A is coded with a linefeed (0x0A) and file B is coded with carriage return + linefeed (0x0D plus 0x0A) as required by windows. Have a look at function "StringAddCR". This adds the "missing" carriage return character. If you read file A, use StringAddCr and rewrite the file then file A should be equal to file B. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
lordicast Posted May 6, 2009 Posted May 6, 2009 Seems that it is reading the [] character as a TAB when this is generated is it using tab or @Crlf or r/n ? [Cheeky]Comment[/Cheeky]
myspacee Posted May 6, 2009 Author Posted May 6, 2009 Thank you all for attention, water thank you for info, but i must decide which is A type and B type file, before act with a script. lordicast sorry but can't understand your info request. any other idea ? m.
Aceguy Posted May 6, 2009 Posted May 6, 2009 (edited) you could use this stringregexp to get the values. 'PVV\d*P\s\w{6}\s\d*' this will work for your posted text file..... but dont know how different (flexible) your other text files will be. Edited May 6, 2009 by Aceguy [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
water Posted May 7, 2009 Posted May 7, 2009 water thank you for info, but i must decide which is A type and B type file, before act with a script.To determine the type of file just read x bytes from the file (x > longest line in file. 200 bytes in the example) and search for the carriage return character#Include <String.au3> $sText = FileRead("C:\TEMP\A.TXT",200) If StringInStr($sText,_HexToString("0D")) = 0 Then ConsoleWrite("Carriage Return not Found" & @CRLF) Else ConsoleWrite("Carriage Return Found" & @CRLF) EndIf My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Zedna Posted May 7, 2009 Posted May 7, 2009 Maybe it will be simpler to use external utils for comparing 2 files. There are some freeware utilities for this also with commandline support: PSPad, WinDiff, WinMerge Resources UDF ResourcesEx UDF AutoIt Forum Search
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now