2016년 11월 21일 월요일

create text file with a new line with each append


Hi all, I am writing an app that appends 2 textbox text into a text file. I am using \n  after each write for the carriage return but the text file that AI2 creates looks like this:

" 363627" " ryuwuwiw" " 373636e6" "dhhehsjs " " 477372u" " ruejjej"

I need the file to be in following format so I can read the text as tab delimited file on a windows app:

" 363627" " ryuwuwiw"
" 373636e6" "dhhehsjs "
" 477372u" " ruejjej"

Any suggestion will be kindly appreciated!

Kind regards,
Sal

-- 
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

Taifun

-- 
Thanks for your reply Taifun. I have attached the block that I using to write to text file.ap2.JPG 표시 중


-- 
you can try to put your values into a list of lists and then use the list to csv table block together with the File.SaveFile block
Taifun

-- 
Thanks Taifun - do you have any example I can follow?

-- 
just try something and if you still have issues, then post a new screenshot of your relevant blocks
see also


Taifun

-- 
I need the file to be in following format so I can read the text as tab delimited file on a windows app


 Does your Windows app have the capability to import commaseparated values instead of tab delimited values?
That makes things easier on the AI2 side.
If not, you need a way to generate tab (X'09') characters on the AI2 side.
See attached TAB.png for how to do that.

If you are uploading your text file to Windows using the wrong program (NFS) you might be missing the automatic addition of CR (x'0D') to the LF characters.
Windows Notepad might not be satisfied with just NL as an end of line character.
Your Windows app might also need the CRLF sequence,

See my CRLF Gallery sample for blocks to generate CR and TAB.

ABG
TAB.png 표시 중

-- 
Thanks ABG, the desktop app does have an option to read .CSV file. Do you have any example I can follow to write the 2 textbox field as 2 comma separated values in one line?

Kind regards,
Sal

-- 

댓글 없음:

댓글 쓰기