AutoHotkey Community

It is currently May 27th, 2012, 3:39 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: July 18th, 2010, 9:14 pm 
Offline

Joined: October 21st, 2006, 5:13 pm
Posts: 23
Why does A_LoopReadLine drop indentation?

e.g. if I run
Code:
Loop, read, TestFile1.txt
{
   NewFile = %NewFile%%A_LoopReadLine%`n
}
FileDelete, TestFile2.txt
FileAppend, %NewFile%, *TestFile2.txt
MsgBox, 64, , complete, 10
ExitApp

on TestFile1.txt containing
Code:
text1
   text2
      text3
   text4
text5

it produces in TestFile2.txt
Code:
text1
text2
text3
text4
text5


How can I preserve the indentation?

Thanks for any advice.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 18th, 2010, 9:24 pm 
Offline

Joined: November 28th, 2009, 4:45 am
Posts: 3089
Quote:
AutoTrim, On|Off
Determines whether "Var1 = %Var2%" statements omit spaces and tabs from the beginning and end of Var2.

Off :D


Last edited by None on July 18th, 2010, 9:25 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 18th, 2010, 9:25 pm 
Quote:
Why does A_LoopReadLine drop indentation?
on purpose.
use:
Code:
AutoTrim, off
to change the default behaviour.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 18th, 2010, 9:47 pm 
Offline

Joined: October 21st, 2006, 5:13 pm
Posts: 23
Thanks guys - perhaps Loop(read file contents) should have a reference to AutoTrim the same as FileReadLine has. :wink:


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], bobbysoon, Google Feedfetcher, Wicked and 13 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group