Using Open with a filename that contains :Importing Quicken Tab Delimited .*TXT File and plottingCreate new file, based on 500 articlesWrite numbers to a fileimport file from directory using sftpImport a column of data, make a matrix from it and export it WITHOUT curly bracesExport to PDF so that Adobe Illustrator does not convert PlotMarkers to fontsExport many lists without using loopsExport[“test.txt”,111] doesn't export anything, generated a blank fileConvert CSV data for use with CandleStickChartChange input filename according to ticker

The rigidity of the countable product of free groups

What is a "Lear Processor" and how did it work?

Why does the Antonov AN-225 not have any winglets?

Could you brine steak?

Party going through airport security at separate times?

Elf (adjective) vs. Elvish vs. Elven

Using Open with a filename that contains :

Why archangel Michael didn't save Jesus when he was crucified?

Integer Lists of Noah

Why is the ladder of the LM always in the dark side of the LM?

What is the minimum time required for final wash in film development?

When I press the space bar it deletes the letters in front of it

[Future]Historical experience as a guide to warship design?

WTB Horizon 47c - small crack in the middle of the tire

Found and corrected a mistake on someone's else paper -- praxis?

What minifigure is this?

How to know if blackberries are safe to eat

Reverse dots and boxes

Help figuring a formula for my job

The joke office

Is it possible to split a vertex?

Can Jimmy hang on his rope?

Misspelling my name on my mathematical publications

What happens when adult Billy Batson says "Shazam"?



Using Open with a filename that contains :


Importing Quicken Tab Delimited .*TXT File and plottingCreate new file, based on 500 articlesWrite numbers to a fileimport file from directory using sftpImport a column of data, make a matrix from it and export it WITHOUT curly bracesExport to PDF so that Adobe Illustrator does not convert PlotMarkers to fontsExport many lists without using loopsExport[“test.txt”,111] doesn't export anything, generated a blank fileConvert CSV data for use with CandleStickChartChange input filename according to ticker






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1












$begingroup$


I am writing some data to a .txt file. I am using Open[] to create the text file in the directory I want and then Write[] and WriteString[]. (I am using FileNameJoin[] to create the actual filenames). I tried this out using a test file, called test.txt (and stored in the appropriate directory), it opens, writes to, and closes the file how I want. However, every time the notebook is run, I want to create a new output .txt file, so the files are named based on the date and time (in 24 hours), so part of the filename looks like HH:MM:SS. So, I am running something that looks like:



filename = 
FileNameJoin["C:", "Users", "Me", "Dir1", "Dir2",
"2019-07-0810:59:01.txt"];
f=OpenWrite[filename]


Mathematica gives this error:



OpenWrite::noopen: Cannot open C:UsersMeDir1Dir22019-07-0810:59:01.txt.


I think what it doesn't like is the colons, since if I replace : with ; it opens/creates the file just fine (and it can open a file with just the date as the name). However, this is kind of ugly, and I would really prefer to use : instead.



Any suggestions are appreciated! Thanks you guys!










share|improve this question







New contributor



Missyinvisible is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






$endgroup$







  • 2




    $begingroup$
    Personally, I solve this problem be replacing XX : YY : ZZ by XXhYYmZZs in the name of the file. Here is the code : StringReplace[DateString[], h : (_ ~~ _) ~~ ":" ~~ m : (_ ~~ _) ~~ ":" ~~ s : (_ ~~ _) :> h ~~ "h" ~~ m ~~ "m" ~~ s ~~ "s"]. It solves a second problem too : sometimes (depending on the operating system) the seconds have decimals (10.45 for instance)
    $endgroup$
    – andre314
    8 hours ago











  • $begingroup$
    If you really want to put colons in file names, I suggest you use Linux. However, even there, I think they are better avoided.
    $endgroup$
    – mikado
    7 hours ago










  • $begingroup$
    Using the StringReplace info from @andre314, you might also consider using DateString["ISODateTime"] such as this: StringReplace[DateString["ISODateTime"], h : (_ ~~ ) ~~ ":" ~~ m : ( ~~ ) ~~ ":" ~~ s : ( ~~ _) :> h ~~ "h" ~~ m ~~ "m" ~~ s ~~ "s"] The result is a more compact representation.
    $endgroup$
    – Mark R
    2 hours ago

















1












$begingroup$


I am writing some data to a .txt file. I am using Open[] to create the text file in the directory I want and then Write[] and WriteString[]. (I am using FileNameJoin[] to create the actual filenames). I tried this out using a test file, called test.txt (and stored in the appropriate directory), it opens, writes to, and closes the file how I want. However, every time the notebook is run, I want to create a new output .txt file, so the files are named based on the date and time (in 24 hours), so part of the filename looks like HH:MM:SS. So, I am running something that looks like:



filename = 
FileNameJoin["C:", "Users", "Me", "Dir1", "Dir2",
"2019-07-0810:59:01.txt"];
f=OpenWrite[filename]


Mathematica gives this error:



OpenWrite::noopen: Cannot open C:UsersMeDir1Dir22019-07-0810:59:01.txt.


I think what it doesn't like is the colons, since if I replace : with ; it opens/creates the file just fine (and it can open a file with just the date as the name). However, this is kind of ugly, and I would really prefer to use : instead.



Any suggestions are appreciated! Thanks you guys!










share|improve this question







New contributor



Missyinvisible is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






$endgroup$







  • 2




    $begingroup$
    Personally, I solve this problem be replacing XX : YY : ZZ by XXhYYmZZs in the name of the file. Here is the code : StringReplace[DateString[], h : (_ ~~ _) ~~ ":" ~~ m : (_ ~~ _) ~~ ":" ~~ s : (_ ~~ _) :> h ~~ "h" ~~ m ~~ "m" ~~ s ~~ "s"]. It solves a second problem too : sometimes (depending on the operating system) the seconds have decimals (10.45 for instance)
    $endgroup$
    – andre314
    8 hours ago











  • $begingroup$
    If you really want to put colons in file names, I suggest you use Linux. However, even there, I think they are better avoided.
    $endgroup$
    – mikado
    7 hours ago










  • $begingroup$
    Using the StringReplace info from @andre314, you might also consider using DateString["ISODateTime"] such as this: StringReplace[DateString["ISODateTime"], h : (_ ~~ ) ~~ ":" ~~ m : ( ~~ ) ~~ ":" ~~ s : ( ~~ _) :> h ~~ "h" ~~ m ~~ "m" ~~ s ~~ "s"] The result is a more compact representation.
    $endgroup$
    – Mark R
    2 hours ago













1












1








1





$begingroup$


I am writing some data to a .txt file. I am using Open[] to create the text file in the directory I want and then Write[] and WriteString[]. (I am using FileNameJoin[] to create the actual filenames). I tried this out using a test file, called test.txt (and stored in the appropriate directory), it opens, writes to, and closes the file how I want. However, every time the notebook is run, I want to create a new output .txt file, so the files are named based on the date and time (in 24 hours), so part of the filename looks like HH:MM:SS. So, I am running something that looks like:



filename = 
FileNameJoin["C:", "Users", "Me", "Dir1", "Dir2",
"2019-07-0810:59:01.txt"];
f=OpenWrite[filename]


Mathematica gives this error:



OpenWrite::noopen: Cannot open C:UsersMeDir1Dir22019-07-0810:59:01.txt.


I think what it doesn't like is the colons, since if I replace : with ; it opens/creates the file just fine (and it can open a file with just the date as the name). However, this is kind of ugly, and I would really prefer to use : instead.



Any suggestions are appreciated! Thanks you guys!










share|improve this question







New contributor



Missyinvisible is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






$endgroup$




I am writing some data to a .txt file. I am using Open[] to create the text file in the directory I want and then Write[] and WriteString[]. (I am using FileNameJoin[] to create the actual filenames). I tried this out using a test file, called test.txt (and stored in the appropriate directory), it opens, writes to, and closes the file how I want. However, every time the notebook is run, I want to create a new output .txt file, so the files are named based on the date and time (in 24 hours), so part of the filename looks like HH:MM:SS. So, I am running something that looks like:



filename = 
FileNameJoin["C:", "Users", "Me", "Dir1", "Dir2",
"2019-07-0810:59:01.txt"];
f=OpenWrite[filename]


Mathematica gives this error:



OpenWrite::noopen: Cannot open C:UsersMeDir1Dir22019-07-0810:59:01.txt.


I think what it doesn't like is the colons, since if I replace : with ; it opens/creates the file just fine (and it can open a file with just the date as the name). However, this is kind of ugly, and I would really prefer to use : instead.



Any suggestions are appreciated! Thanks you guys!







export import text output






share|improve this question







New contributor



Missyinvisible is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










share|improve this question







New contributor



Missyinvisible is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








share|improve this question




share|improve this question






New contributor



Missyinvisible is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








asked 8 hours ago









MissyinvisibleMissyinvisible

83 bronze badges




83 bronze badges




New contributor



Missyinvisible is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




New contributor




Missyinvisible is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









  • 2




    $begingroup$
    Personally, I solve this problem be replacing XX : YY : ZZ by XXhYYmZZs in the name of the file. Here is the code : StringReplace[DateString[], h : (_ ~~ _) ~~ ":" ~~ m : (_ ~~ _) ~~ ":" ~~ s : (_ ~~ _) :> h ~~ "h" ~~ m ~~ "m" ~~ s ~~ "s"]. It solves a second problem too : sometimes (depending on the operating system) the seconds have decimals (10.45 for instance)
    $endgroup$
    – andre314
    8 hours ago











  • $begingroup$
    If you really want to put colons in file names, I suggest you use Linux. However, even there, I think they are better avoided.
    $endgroup$
    – mikado
    7 hours ago










  • $begingroup$
    Using the StringReplace info from @andre314, you might also consider using DateString["ISODateTime"] such as this: StringReplace[DateString["ISODateTime"], h : (_ ~~ ) ~~ ":" ~~ m : ( ~~ ) ~~ ":" ~~ s : ( ~~ _) :> h ~~ "h" ~~ m ~~ "m" ~~ s ~~ "s"] The result is a more compact representation.
    $endgroup$
    – Mark R
    2 hours ago












  • 2




    $begingroup$
    Personally, I solve this problem be replacing XX : YY : ZZ by XXhYYmZZs in the name of the file. Here is the code : StringReplace[DateString[], h : (_ ~~ _) ~~ ":" ~~ m : (_ ~~ _) ~~ ":" ~~ s : (_ ~~ _) :> h ~~ "h" ~~ m ~~ "m" ~~ s ~~ "s"]. It solves a second problem too : sometimes (depending on the operating system) the seconds have decimals (10.45 for instance)
    $endgroup$
    – andre314
    8 hours ago











  • $begingroup$
    If you really want to put colons in file names, I suggest you use Linux. However, even there, I think they are better avoided.
    $endgroup$
    – mikado
    7 hours ago










  • $begingroup$
    Using the StringReplace info from @andre314, you might also consider using DateString["ISODateTime"] such as this: StringReplace[DateString["ISODateTime"], h : (_ ~~ ) ~~ ":" ~~ m : ( ~~ ) ~~ ":" ~~ s : ( ~~ _) :> h ~~ "h" ~~ m ~~ "m" ~~ s ~~ "s"] The result is a more compact representation.
    $endgroup$
    – Mark R
    2 hours ago







2




2




$begingroup$
Personally, I solve this problem be replacing XX : YY : ZZ by XXhYYmZZs in the name of the file. Here is the code : StringReplace[DateString[], h : (_ ~~ _) ~~ ":" ~~ m : (_ ~~ _) ~~ ":" ~~ s : (_ ~~ _) :> h ~~ "h" ~~ m ~~ "m" ~~ s ~~ "s"]. It solves a second problem too : sometimes (depending on the operating system) the seconds have decimals (10.45 for instance)
$endgroup$
– andre314
8 hours ago





$begingroup$
Personally, I solve this problem be replacing XX : YY : ZZ by XXhYYmZZs in the name of the file. Here is the code : StringReplace[DateString[], h : (_ ~~ _) ~~ ":" ~~ m : (_ ~~ _) ~~ ":" ~~ s : (_ ~~ _) :> h ~~ "h" ~~ m ~~ "m" ~~ s ~~ "s"]. It solves a second problem too : sometimes (depending on the operating system) the seconds have decimals (10.45 for instance)
$endgroup$
– andre314
8 hours ago













$begingroup$
If you really want to put colons in file names, I suggest you use Linux. However, even there, I think they are better avoided.
$endgroup$
– mikado
7 hours ago




$begingroup$
If you really want to put colons in file names, I suggest you use Linux. However, even there, I think they are better avoided.
$endgroup$
– mikado
7 hours ago












$begingroup$
Using the StringReplace info from @andre314, you might also consider using DateString["ISODateTime"] such as this: StringReplace[DateString["ISODateTime"], h : (_ ~~ ) ~~ ":" ~~ m : ( ~~ ) ~~ ":" ~~ s : ( ~~ _) :> h ~~ "h" ~~ m ~~ "m" ~~ s ~~ "s"] The result is a more compact representation.
$endgroup$
– Mark R
2 hours ago




$begingroup$
Using the StringReplace info from @andre314, you might also consider using DateString["ISODateTime"] such as this: StringReplace[DateString["ISODateTime"], h : (_ ~~ ) ~~ ":" ~~ m : ( ~~ ) ~~ ":" ~~ s : ( ~~ _) :> h ~~ "h" ~~ m ~~ "m" ~~ s ~~ "s"] The result is a more compact representation.
$endgroup$
– Mark R
2 hours ago










1 Answer
1






active

oldest

votes


















5












$begingroup$

This is not possible. A colon is not a valid character in a file name on Windows.



Reference: https://docs.microsoft.com/en-us/windows/win32/msi/filename






share|improve this answer









$endgroup$












  • $begingroup$
    You're right @Szabolcs, thanks! I am just so used to Linux.
    $endgroup$
    – Missyinvisible
    6 hours ago













Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






Missyinvisible is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f201760%2fusing-open-with-a-filename-that-contains%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









5












$begingroup$

This is not possible. A colon is not a valid character in a file name on Windows.



Reference: https://docs.microsoft.com/en-us/windows/win32/msi/filename






share|improve this answer









$endgroup$












  • $begingroup$
    You're right @Szabolcs, thanks! I am just so used to Linux.
    $endgroup$
    – Missyinvisible
    6 hours ago















5












$begingroup$

This is not possible. A colon is not a valid character in a file name on Windows.



Reference: https://docs.microsoft.com/en-us/windows/win32/msi/filename






share|improve this answer









$endgroup$












  • $begingroup$
    You're right @Szabolcs, thanks! I am just so used to Linux.
    $endgroup$
    – Missyinvisible
    6 hours ago













5












5








5





$begingroup$

This is not possible. A colon is not a valid character in a file name on Windows.



Reference: https://docs.microsoft.com/en-us/windows/win32/msi/filename






share|improve this answer









$endgroup$



This is not possible. A colon is not a valid character in a file name on Windows.



Reference: https://docs.microsoft.com/en-us/windows/win32/msi/filename







share|improve this answer












share|improve this answer



share|improve this answer










answered 8 hours ago









SzabolcsSzabolcs

169k17 gold badges461 silver badges983 bronze badges




169k17 gold badges461 silver badges983 bronze badges











  • $begingroup$
    You're right @Szabolcs, thanks! I am just so used to Linux.
    $endgroup$
    – Missyinvisible
    6 hours ago
















  • $begingroup$
    You're right @Szabolcs, thanks! I am just so used to Linux.
    $endgroup$
    – Missyinvisible
    6 hours ago















$begingroup$
You're right @Szabolcs, thanks! I am just so used to Linux.
$endgroup$
– Missyinvisible
6 hours ago




$begingroup$
You're right @Szabolcs, thanks! I am just so used to Linux.
$endgroup$
– Missyinvisible
6 hours ago










Missyinvisible is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















Missyinvisible is a new contributor. Be nice, and check out our Code of Conduct.












Missyinvisible is a new contributor. Be nice, and check out our Code of Conduct.











Missyinvisible is a new contributor. Be nice, and check out our Code of Conduct.














Thanks for contributing an answer to Mathematica Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f201760%2fusing-open-with-a-filename-that-contains%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

199年 目錄 大件事 到箇年出世嗰人 到箇年死嗰人 節慶、風俗習慣 導覽選單