4 Replies - 672 Views - Last Post: 09 February 2013 - 07:11 AM Rate Topic: -----

#1 summer_breeze  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 56
  • Joined: 27-July 12

Writing Special Characters To A Text File

Posted 09 February 2013 - 04:13 AM

I tried to write "2/9/2013" to a text file.
But failed to do so.

Is it possible to write "/" including others characters contained in a string in the text file?"
Is This A Good Question/Topic? 0
  • +

Replies To: Writing Special Characters To A Text File

#2 sepp2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2113
  • View blog
  • Posts: 3,235
  • Joined: 21-June 11

Re: Writing Special Characters To A Text File

Posted 09 February 2013 - 04:37 AM

It's perfectly possible to write a string containing /s to a file - there's nothing special about the / character. If your code failed, it must have failed for different reasons.
Was This Post Helpful? 0
  • +
  • -

#3 snoopy11  Icon User is offline

  • Engineering ● Software
  • member icon

Reputation: 773
  • View blog
  • Posts: 2,287
  • Joined: 20-March 10

Re: Writing Special Characters To A Text File

Posted 09 February 2013 - 04:52 AM

View Postsummer_breeze, on 09 February 2013 - 11:13 AM, said:

I tried to write "2/9/2013" to a text file.
But failed to do so.

Is it possible to write "/" including others characters contained in a string in the text file?"

Did you mean to post

I tried to write "2\9\2013" to a text file but failed to do so....

as the character "/" is not a special character however "\" is and you need to write

"2\\9\\2013" for it to show up as "2\3\2013"

Best Wishes

Snoopy.
Was This Post Helpful? 1
  • +
  • -

#4 sepp2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2113
  • View blog
  • Posts: 3,235
  • Joined: 21-June 11

Re: Writing Special Characters To A Text File

Posted 09 February 2013 - 05:14 AM

View Postsnoopy11, on 09 February 2013 - 12:52 PM, said:

I tried to write "2\9\2013" to a text file but failed to do so....


Why would they write a date using backslashes? I mean I get where you're coming from since the OP talked about special characters, but who formats dates using backslashes?

This post has been edited by sepp2k: 09 February 2013 - 05:19 AM

Was This Post Helpful? 1
  • +
  • -

#5 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3572
  • View blog
  • Posts: 11,107
  • Joined: 05-May 12

Re: Writing Special Characters To A Text File

Posted 09 February 2013 - 07:11 AM

<sarcasm>
Who uses colons as path separators?
</sarcasm>
Mac OS users.
:)

Seriously, though, it's unlikely that somebody uses backslashes for formatting dates, at least based on what I can see here: http://en.wikipedia....rmat_by_country
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1