Archive for the ‘Windows General’ Category

Change Column Separator on CSV in OpenOffice Calc

August 3, 2017

If you want to change the existing column separator or the “delimiter” of a CSV in open office, follow the easy steps :

  • open the csv in openoffice calc
  • go to file-> save as
  • opens the typical save dialog boxUntitled
  • Select the Edit Filter Settings option and click save
  • Opens up a dialog box to change all the default settings.Untitled
  • Change whatever you need and click Ok, and thats all.

Its so easy, but so much hidden with weird settings name. Hope it will be helpful for someone. Enjoy and happy coding!

 

Execute SQLLdr without tnsnames.ora entry

February 1, 2012

In my last post, I discovered that we can run sqlplus without having an entry in tnsnames. I was under the impression that it will work the same way in sqlldr also. But it was a mistake as sqlldr told me I am giving it the wrong syntax. I spend lots of time on that to find out finally that, I need to escape the brackets and need to put a double quotes which itself should be escaped around the connection string. So it goes like this :

sqlldr username/pwd@\”\(DESCRIPTION=\(ADDRESS=\(PROTOCOL=TCP\)\(HOST=yourhost.domain\)\(PORT=1521\)\)\(CONNECT_DATA=\(SERVER=DEDICATED\)\(SID=yourservice\)\)\)\” control=control_file.ctl errors=1000 ROWS=50000

That’s it guys. Happy Coding. 🙂

How to connect SQLPlus without tnsnames.ora entry

January 31, 2012

In some weird companies, like the one am working, will restrict many things in our machine which will reduce the productivity. Recently I was trying to add a new entry in tnsnames when our database server got changed. And hell, I was not having rights to change the tnsnames file in my local machine!!! WTF!!! At the end of day I need to run one sqlplus command from the command prompt. SQLPlus needs an entry in the TNS Names file in order to work. Then I found out an way to execute the command by directly giving the connection string in the sqlplus command itself. Like this :

sqlplus username/password@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost.mydomain)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=servicename)))

BINGO! It works as hell. Please remember that there shouldn’t be any space in the connection string, also no carriage return (which might happen if you are copying the string from the tnsnames file.

Thats it guys. Happy Coding. 🙂

Echo Current Date and Time in Batch File

January 24, 2012

How stupid I am! In one batch file I need to print the current date and time and I googled for 5 mins to find it out. 😛 So here it is. For the other guys like me. he he.

ECHO Starting stored procedures execution at %date% – %time% >> log_file.log

Happy Coding. 🙂

Adding Keyboard Shortcut to Microsoft Office

December 20, 2010

Being a fan of Keyboard shortcuts, I always wanted all those frequent operations I do on my machine to be available as Keyboard Shortcuts. Today I was searching for the Toggle Full Screen keyboard shortcut in Microsoft Word. But to my surprise it was not available. Did some googling and found out that we can add custom shortcuts for Word. To add custom shortcut :

  1. Choose Customize from the Tools menu. Word displays the Customize dialog box.
  2. Click the Keyboardbutton. Word displays the Customize Keyboard dialog box.
  3. In the list of Categories, choose View.
  4. In the list of Commands, choose ToggleFull.
  5. Place the insertion point in the Press New Shortcut Key box.
  6. Press the shortcut key you want to use, such as Alt+L.
  7. Click Assign.
  8. Close the dialog boxes.

The interesting thing is that, when you input one new shorcut, Word will show whether this shortcut is already assigned to any other shortcuts. I preferred Alt+L since I wanted the similar shortcut available in Adobe Reader for toggling full screens for Pdf (Ctl+L), but this was already assigned in word.

🙂

Unix Tail command in DOS Batch

December 20, 2010

I was struggling the last days for converting my applications from UNIX servers to Windows servers. The main difficulty I faced was the conversion of the shell scripts to DOS Batch scripts. Since I was not that expert in UNIX Shell commands, it was a challenge for me. I will keep on posting the different conversions I did. This is the first one.

The tail command in UNIX will take the last specified number of lines from the input given. The below line of command will take last 20 lines from del_temp.log and put into value.log.

tail -20 del_temp.log >> value.log

This single line tail command can be converted to its equivalent DOS Batch by the below block of code.

SETlocal EnableExtensions
SET tailCount=20
SET fileName=del_temp.log
SET output=value.log
FOR /F “usebackq tokens=3,3 delims= ” %%l IN (`find /c /v “” %fileName%`) DO (call SET find_lc=%%l)
SET /a linenumber = %find_lc% – %tailCount%
IF %linenumber% LSS 1 (
more +0 %fileName% >> %output%
) ELSE (
more +%linenumber% %fileName% >> %output%
)
endLocal

Enjoy and Happy Coding Guys 🙂