Page 1 of 1

How to add tab in Fileappend?

Posted: 13 Jan 2023, 10:34
by wetware05
Hi.

In the next line how to separate the two variables with a tab?

Code: Select all

String1:="In the next line how to separate the two variables with a tab?"
String2:="If you want to join two text strings into one, how to add a tab between the two."
FileAppend, %String1% %String2%, File.txt ;Add Tab


Or failing that. If you want to join two text strings into one, how to add a tab between the two.

Code: Select all

String1:="In the next line how to separate the two variables with a tab?"
String2:="If you want to join two text strings into one, how to add a tab between the two."
String3:=  %String1% %String2% ;Add Tab
FileAppend, %String3%, File.txt

Re: How to add tab in Fileappend?

Posted: 13 Jan 2023, 10:42
by AHKStudent
A_Tab https://www.autohotkey.com/docs/v1/Variables.htm#Tab

Code: Select all

 FileAppend, %String1% %A_Tab% %String2%, File.txt 

Re: How to add tab in Fileappend?

Posted: 13 Jan 2023, 11:02
by wetware05
AHKStudent wrote:
13 Jan 2023, 10:42
A_Tab https://www.autohotkey.com/docs/v1/Variables.htm#Tab

Code: Select all

 FileAppend, %String1% %A_Tab% %String2%, File.txt
Thank you @AHKStudent.

In the second case, can't you...? I know it can be put at the end of the first string, or at the beginning of the second, but in case they are strings that are generated during the script (user input), can't it be joined into a new String with a tab between it both of them?

Re: How to add tab in Fileappend?

Posted: 13 Jan 2023, 11:22
by AHKStudent
wetware05 wrote:
13 Jan 2023, 11:02
AHKStudent wrote:
13 Jan 2023, 10:42
A_Tab https://www.autohotkey.com/docs/v1/Variables.htm#Tab

Code: Select all

 FileAppend, %String1% %A_Tab% %String2%, File.txt
Thank you @AHKStudent.

In the second case, can't you...? I know it can be put at the end of the first string, or at the beginning of the second, but in case they are strings that are generated during the script (user input), can't it be joined into a new String with a tab between it both of them?
Not sure I knw what you mean

Try

Code: Select all

String3:=  String1 String2 A_tab