xcaliber13 Posted December 31, 2018 Share Posted December 31, 2018 Hello, I am having an issue with pulling a file into an Array. I have a pipe | delimited text file. Now I can pull that file into excel with no issues. All the columns and rows are good. Now with no issue pulling that file into excel shouldn't I be able to file read to array using the pipe | delimiter? But I cannot get this file into an array using the pipe delimiter. _FileReadToArray("C:\OPATemp\temp.txt", $avArray, $FRTA_NOCOUNT, "|") ;No array created. @error 1 $avArray is not an array _FileReadToArray("C:\OPATemp\temp.txt", $avArray, $FRTA_NOCOUNT) ;Creates an array but all in one column _FileReadToArray("C:\OPATemp\temp.txt", $avArray, $FRTA_NOCOUNT + $FRTA_INTARRAYS, "|") ; Creates an array of arrays It is with this last one that I noticed the issue. The array of arrays are different lengths. But that is what is confusing me. How can that be if I am able to pull into excel with no issues? Thank you for any help Link to comment Share on other sites More sharing options...
Nine Posted December 31, 2018 Share Posted December 31, 2018 There must be an error in your file, you must have too many delimiters on some lines, compare to others. They need to be perfectly identical in each line. That is probably why it is working for array of arrays... Upload the file if you can't find the discrepancies “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
xcaliber13 Posted December 31, 2018 Author Share Posted December 31, 2018 Nine Thank you for the reply. Yes I do know that they need to be perfectly identical in each line but wouldn't that be the same to pull the file into Excel? File pulls into Excel using the pipe delimiter with no issues. Link to comment Share on other sites More sharing options...
iamtheky Posted December 31, 2018 Share Posted December 31, 2018 can you upload one of these files, or a reasonable snippet thereof? ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Nine Posted December 31, 2018 Share Posted December 31, 2018 (edited) 19 minutes ago, xcaliber13 said: but wouldn't that be the same to pull the file into Excel? No it is not a requirement in Excel. It will pull whatever there is in the file. In autoit, that is why you have array of arrays, in case each lines don't respect the same number of delimiters...Look at a trailing useless delimiter Edited December 31, 2018 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy 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