0

How can i write binvar to a file with line breaks?

noop $hget(row, siirMisralari_txt, &binvar)
fopen poemFile temp_text.txt
fwrite -bn poemFile &binvar
fclose poemFile
bunset &binvar

This code can t include line breaks.

nikel
  • 653
  • 4
  • 13
  • 24

2 Answers2

1
bwrite temp_text.txt 0 $hget(row, siirMisralari_txt, &binvar) &binvar
Wiz
  • 2,145
  • 18
  • 15
  • i just noticed it. windows notepad can t show line feeds but notepad++ does. – nikel Dec 06 '11 at 05:20
  • if it's just `$lf` then yea, you can't open it in notepad. But `$crlf` will. Wordpad will do fine for either I believe. – Wiz Dec 06 '11 at 06:07
-1

That's the fantastic of binary! It can contain any binary values! Your line breaks must be lost before adding the binary data to the hash table. You need /hadd -b if you're working with binvars there.
You can /echo -a $bvar(&binvar,1-) and search for the line breaks depending on what format the file had/has.
Unix: LF ($chr(10)), Win: CRLF ($+($chr(13),$chr(10))), Mac: CR ($chr(13)).

unNamed
  • 969
  • 1
  • 10
  • 18
  • thanks for the answer. i want to make it clear. i m trying to get data from sqlite database and send lines to irc server. how can i save all lines of a long text to a file with line breaks? i don't know much about hash tables and i doubt if it s necessary. this code: http://sudrap.org/paste/text/43813/ can t keep utf8 format. – nikel Dec 06 '11 at 03:47