Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fputs String Length - How do I get past 256 char. limit?

Status
Not open for further replies.

lakehouse

Technical User
May 17, 2004
45
US
How do I get around the 256 character limit of "fputs".

I have data I need to put into a long, single row of a text file. I have concatinated data into long strings and I see there is a limit to how much can be written in one command. But I need to keep it in one single row for later exporting to Excel.

Since my data is concatinated from smaller strings, I could write to the row in several passes, then finalize the row with a CR/LF.
 
You can use fwrite instead of fputs. You will still hit the 256 character limitation for writing the data, but there will be no CR or LF at the end of each string, so you should be able to issue multiple fwrite commands and have it look OK in the end. You will just need to add an fwrite command to add a trailing CR and LF (`r`n) so that Excel recognizes the end of the line.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top