Hopefully a simple one for you (or at least seemingly)!
I import a .txt file, from which i make a ListLinePlot. I simply want to read in the name of the file, store it in a variable so I can use it to tag my plots later.
Data = Import["C:\\Users\\Name\\Folder\\test2.txt", "CSV"];
ListLinePlot[Transpose[{Data[[All, 1]], Data[[All, 2]]}],
Frame -> True,
PlotRange -> {{Data[[All, 1]][[
First@Flatten[Position[Data, {_, Max[Data[[All, 2]]]}]]]]
- 0.0003,
Data[[All, 1]][[
First@Flatten[Position[Data, {_, Max[Data[[All, 2]]]}]]]]
+ 0.0003}}, FrameTicks -> Automatic, Axes -> False,
PlotStyle -> Directive[Black, Thin],
FrameLabel -> {"SIMULATION TIME STEP [\[Mu]s]",
"PARTICLE NUMBER [#]"}]
Here is my code I'm using to plot, the filename is "test2", and it is that I would like to extract.
Thanks in advance,
QP