Nubie Posted April 6, 2015 Share Posted April 6, 2015 I found when try detect "//" symbol #include <file.au3> Local $aRecords _FileReadToArray("test.txt",$aRecords) _ArrayDisplay($aRecords, "") Then it showed Btw, is possible for detect symbols "//" stay before other charaters ? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 6, 2015 Moderators Share Posted April 6, 2015 Nubie,Works fine when I try it: #include <File.au3> #include <Array.au3> $sFileName = "Test.txt" FileWrite($sFileName, " //aaaaaaa" & @CRLF & "dfgdfgdfg") Local $aRecords _FileReadToArray("test.txt",$aRecords) _ArrayDisplay($aRecords, "") $sText = FileRead($sFileName) MsgBox($MB_SYSTEMMODAL, "Content", $sText) FileDelete($sFileNameI think your file has some non-printing characters which are creating another linebreak. Try looking at the file in Hex and see if you can see anything - or post it here so we can take a look. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Nubie Posted April 6, 2015 Author Share Posted April 6, 2015 Yes you're right. Maybe it's bug with notepad. Don't know why I have it. Thanks! Link to comment Share on other sites More sharing options...
SadBunny Posted April 7, 2015 Share Posted April 7, 2015 (edited) Not a bug. It is a linefeed character, ascii char number 10 (or 0A in hex). In AutoIt, this is denoted by @LF. Windows Notepad only recognizes Windows newlines, which consist of both a carriage return (ascii char 13, 0D in hex, @CR in AutoIt) and a line feed. Consider this example: $file = FileOpen("c:\temp\file.txt", 2) FileWrite($file, "A" & @CR & "B" & @CR) FileWrite($file, @CRLF & @CRLF) FileWrite($file, "A" & @LF & "B" & @LF) FileWrite($file, @CRLF & @CRLF) FileWrite($file, "A" & @CRLF & "B" & @CRLF) FileWrite($file, @CRLF & @CRLF) FileClose($file) (note: will overwrite c:temptest.txt!) Then look at the file in notepad.exe and notice that only the last AB are on separate lines. (/edit: and check in notepad++ what it actually looks like.) So not a bug. Well, not really, depends how you look at it I guess. It's just how notepad.exe has worked forever and it's a major PITA for people who try to mix unix/linux and windows textfiles... And it's clearly considered a "wontfix" by Microsoft. Edited April 7, 2015 by SadBunny Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
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