• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

On parsing .dat file trailing spaces are being trimmed.

Brucemac

New Member
I have a large fixed width file that i am importing to excel 2016. I am using the array(nn, 2) in general to grab the columns I need. I am manipulating them and then putting it back together for use in the native application.
The problem is that if I grab a column and the end of the previous column has blanks it will trim those when importing. So, when I put it back together those missing blanks cause the file to fail.
Any way to prevent the trimming?
 
Welcome to Chandoo Org forums! Your description is unclear (at least to me).

Describe the method of import, post the code. Post some sample data where it doesn't work for you.
 
I removed the reference lookup data because the file was too large. So the calcs page looks wrong. Buts its not needed to demonstrate the issue.
Paste the raw data in A1 of sheet 1 and run the script.
Note in the first couple lines, in Column E the last few characters are "D72". Now look back at column 192 & 193 of the raw data. There are two blank spaces. But these are gone after import. I need to find a way that all spaces are maintained.
 

Attachments

  • Dat file conversion template reference removed.xlsm
    53.6 KB · Views: 2
  • TA582.73426.FM00092.09012018.txt
    65.1 KB · Views: 3
Back
Top