How do i change my text .txt file to a .ora - tnsnames

So I tried to use tnsnames.ora in oracle, but it will not recognize my file and has a blank network alias while creating a tns connection. I found out that the file type is not correct.
My VScode and sublime text do not give me the options to save a oracle file.

Related

Stata can't open file saved in local cloud storage folder on Mac

I am using Stata on a Mac. I updated the OS to Monterey today. If I try to open a .dta file---that is saved on my local computer in a folder that syncs to OneDrive---from code in the Do File Editor/Command prompt (where I refer to the file using its full file path), it doesn't open. The error is r(601) - File ... cannot be found.
But if I click on it in Finder, it opens in Stata just fine. After I have done this, I can then open this file in Stata by running the exact same Stata code that didn't work before. Somehow it seems like Stata can't see the file/folder initially, but then it can. I am not sure if this has to do with the OneDrive file/folder permissions or something else.
If, in Stata, I change the directory to the correct directory using cd and then load the file (without referring to the path), it works. However, I would like to be able to refer to the file using the entire file path and not have to change the directory each time.
Interestingly, if I change the directory to the correct directory using Change working directory in the File drop down and then try to load the file using the file path, it also works. But if I do not do the drop down and write out the cd using code, and try accessing the file using the path it doesn't work!
Somehow Stata has to initially "see"/"access" the correct folder (in a very particular way) before being able to access it with the file path. Very strange. (Just to be clear, if I do not change the directory to the correct directory and then try to load the file using its file path, it doesn't work.)
I also tried creating a file using texdoc init... (in a folder that already exists, but that has not been used by Stata before) and get this error:
could not create directory .....
mkdir(): 693 could not create directory
texdoc_mkdir(): - function returned error
texdoc_init(): - function returned error
<istmt>: - function returned error
I do not get this error if I instead use another folder in the same directory that I have previously used.
I think that the error I am encountering is the same or similar to this one (with no acceptable answer): https://answers.microsoft.com/en-us/msoffice/forum/all/onedrive-folder-doesnt-exist/e6b97d47-3f6a-4863-bf68-d3a02832f2bb

How to save .env file in windows?

I tried to save file with .env file extension but I could not see any .env file extension in save as dropdown option.
I also tried to rename it as .env but it gets saved as text file (see screenshot) how can I fix this issue ?
If you use Windows, to save any file with an extension different from the default extension of the tool you are using, You have to select the option which appears like:
All Files or All Files (*.*) in the Type of File dropdown in the save dialogs.
Open your xx.env file with notepad++ and file -> saveas -> rename to .env and save
In windows normally you can not create a file without name. So to create a .env file there are three ways I know...
Copy paste from somewhere else
If you have installed php then run this command in console php -r "copy('anyfile.example', '.env');"
Create a txt file called anything.txt open CMD and find its dir then run ren anything.txt .env
Follow the steps below:
Open Notepad or Notepad++ and write the context in the file.
Notepad workspace screen with some context
Goto FILE-> SAVE AS
Save as Screen in the notepad
Select the All files()All files selection
Save the file with .env in the end.env extension
You've created .env file.env file
I've tried to create .env file in VS Code but it didn't work somehow. If you've any idea please let me know.
Steps to create .env file in Windows machine:
Open a Notepad and write the credentials inside the file
Click on Save option and change the file type to 'All files'
Keep the file name as .env
Hit Save
Now the file is an .env file. You can also check the file type in File Explorer to confirm.
One thing to remember is to put the file inside your Project directory where your code which accesses this .env file is stored.
You can open notepad
Type the information
go to file
click on save
change the file type to (.)
You can create a .env file in an IDE directly, like Visual Studio Code.
1.) Just right-click on the directory and create a new file.
2.) Name it as .env

How to create a .gitignore file in Windows 10 [duplicate]

This question already has answers here:
How do I manually create a file with a . (dot) prefix in Windows? For example, .htaccess
(17 answers)
Closed 3 years ago.
I tried to create a .gitignore file in my repository's root directory with the command
$ touch .gitginore
in Git Bash.
But when I looked at the file from the Windows Explorer. It says it's a text document. Isn't it supposed to be of the type File?
touch .gitignore works just fine. Windows detects it as a text file but git should works perfectly.
To be sure of it, you can type ls -la and you should see all your files with their extensions, including .gitignore just like in the following picture:
Since the question does not specify any required tools, this contains a solution if you want to create a .gitignore file using command prompt or Windows Explorer.
Command Prompt:
In case one receives the following error message on a Windows 10 system in command prompt because touch is a command of git bash:
'touch' is not recognized as an internal or external command, operable
program or batch file.
You can either use the following command in command prompt (cmd):
echo. > .gitignore
or
type nul > .gitignore
as indicated here: Windows equivalent of 'touch' (i.e. the node.js way to create an index.html). This procedure will not generate a Text Document as indicated in the problem statement, but a file that appears to not have any extension.
Windows Explorer:
If you try to do it in Windows 10 Explorer by clicking right mouse button(RMB)>New>Text Document and you try to name it .gitignore you can receive the following error:
You must type a file name.
This can be overcome by giving it the filename .gitignore.. So if your git repository folder contains a folder named output which you want to suppress/not sync, you can add it to the .gitignore by editing the .gitignore. file with a text editor and adding a line that contains /output. This last procedure generates a file which is also a .txt document as indicated in the problem statement, but as mentioned by #hobbs and #Youkool that is not a problem for git. Furthermore, the last procedure is verified in Windows 10 with git version 2.16.1.windows.4.
but when I looked at the file from the windows explorer. It says it's a text document. Isn't it supposed to be of the type File
Windows says your README is of type File because it has no extension. In contrast, your .gitignore file has the extension .gitignore which Windows has been configured to report (probably by the git-for-windows installer) the type Text Document.
Please refer to How do I manually create a file with a . (dot) prefix in Windows? For example, .htaccess.
Reproducing for your easy access: In File Explorer, right click anywhere and create a new file. Type the new filename as .something. (notice the appended period) and press Enter twice, job done.

"You must type a file name" error thrown, when I create a .gitignore file on Windows

When I try to do this, I get the following error:
Obviously, Windows Explorer doesn't allow me to create this type of file patterns. How can I overcome this problem?
In the File Explorer, the trick is to call your file .gitignore. and it will remove the ending .
A strange behavior but, hey!, it works 😅
Or create it from a text editor...
Windows Explorer doesn't allow you to create files that consist essentially of a file extension only. This is because Windows Explorer has the option to hide file extensions, leaving you with a file you cannot see (see Why doesn’t Explorer let you create a file whose name begins with a dot?). This is not a restriction of Windows itself, or the file system in use, though.
To create a file named .gitignore, you will have to use another tool to create it. A common solution is to create a text file (e.g. test.txt), open it in Notepad, and select Save As... to rename the file to .gitignore.
The Windows command interpreter also allows you to create files without imposing the additional restrictions of Windows Explorer. A more direct solution would then be to create the file from the command line. This can be done using the following command:
copy NUL .gitignore
Note: When dealing with files that don't have a name, it's helpful to disable the option "Hide extensions for known file types" in Windows Explorer. Otherwise Windows Explorer might show files with no names, or hide them altogether.
In cmd, just type
echo. 2>.name_you_want
or
. 2>.name_you_want
to create a file.
If creating a directory, just type
mkdir .folder_name_you_want
Use command line instead.
I was also having the same error. The problem was . at the start of file or folder name.
So I created it by command line.
You can do this with command prompt for folder creation:
mkdir .folder_name

Saving SQL files into specific folders in Oracle

I am using Oracle 11g. When I open a new SQL file writing the command
ed filename.sql
A new file is created in my bin folder with the name as filename but, I want them to be in separate folders for my convenience. I am developing 3 application(well for my practice only). I want them to store in different folders for each project. I tried all of the following none of them worked please tell me how can I save the files into specific folders.
ed erp/logindetails.sql
ed 'erp/logindetails.sql'
ed "erp/logindetails.sql"
ed 'erp\logindetails.sql'
ed erp\logindetails.sql
These commands except where I used "" worked and opened the default text editor with the name afiedt.buf which I am getting when I enter only edit. No files are created with any of the above command.
You're giving EDIT a relative path to the file; since your current working directory seems to be the bin directory that the SQL*Plus directory is in (is this Windows, and are you running a shortcut that sets the working directory, maybe?) it will try to create a file like %ORACLE_HOME%\bin\erp\logindetails.sql, and you're unlikely to have created an erp directory there. Giving the full path to the directory will work:
edit c:\users\dibya\projects\erp\logindetails.sql
for example.
As noted in the documentation, EDIT will search for existing files, but that involves setting an environment variable - which you'd have to change as you move between the projects. You might find it easier to edit the files in the OS and just run them from SQL*Plus.
You might also be able to use separate shortcuts to launch SQL*Plus for each project, each setting the 'start in' directory to a project-specific location - then just edit logindetails.sql would be looking in the right place by default. Or, from a command prompt cd into the relevant project-specific directory and launch SQL*Plus from there, which is effectively what a shortcut would do.

Resources