Skip to main content

Posts

PowerShell repeat spaces or characters

Example code of repeating   spaces within a string: $xrepeat = ' ' * 11 $string_with_spaces = “ Hello World of Spaces!!!” Write-output   $xrepeat $string_with_spaces Output image: To indent or tab a string: $Tab = [char]9 Write-Output "$Tab Hello Tab Indention!!!" Output image: To add other HTML character in PowerShell string: $Euro_symbol = [char]8364 Write-Output "$Euro_symbol Hello Euro Symbol in PowerShell!!!" Output image: ================================ Free Android Apps: Click  links below to find out more: Excel Keyboard guide: https://play.google.com/store/apps/details?id=chrisjoms.myexcelapplicationguide Heaven's Dew Fall  Prayer app for Android : https://play.google.com/store/apps/details?id=soulrefresh.beautiful.prayer Catholic Rosary Guide  for Android: ...

Excel Macro get cell values but skip other rows

Raw data that comes in pattern is easy to handle for further processing. For example, if you have a data that has final value in every 7 th row, so basically 1 to 6 is not needed and 7 th row is needed, likewise 8 th row to 13 th row is not needed and 14 th row is needed and the pattern goes on that every 7 th row is the final data from the previous 6 rows. If the pattern continues, it will be like: 1-6, 7 final value, 7 -13, 14 final value, 15 to 20, 21 final value, 22 to 27, 28 final value and the pattern goes on up to hundreds or thousands. It will be time consuming to get every 7th row manually. For graphical representation it will be like: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 From the image above every 7 th row (green color) is needed and the rest is discarded. Other issue comes in if the data has to be processed further in another sheet,...

Working with text in PowerShell

Working with a text file or text format in PowerShell is a good thing to learn. Getting or monitoring output from PowerShell for further processing or analysis and having it in text file format can easily be imported to other applications. Working with text or other format, requires these basic operations: S ave, Overwrite, Append and Save As. Save, overwrite, append and save as is a common operation when editing word documents, excel file and other office applications since it’s freely available on the menu of the application. But can we do this in PowerShell? The answer is a resounding, yes. So, how to do it? Examples below shows how to work with text files in PowerShell and do the operation mentioned above. Equivalent operations for Save, Overwrite, Append and Save As in PowerShell: ===Set-content ==== will overwrite the file ===Add-content ==== will just add or append something to the file ===Out-File ==== is like "Save As" since you ...

Disable Maximize and Minimize control in a form using Visual Studio

How to disable minimizing and maximizing a form in C# or VB.net? How to create a border less form in Visual Studio? Images below shows how to disable maximize and minimize control in a form. Image below shows how to deactivate maximize option in a form: Image of a form that does not allow maximizing: Image below shows how to create a border less form, creating a border less form should provide an option within the form how to close the application. Image of a border less form: Till next time.. Have fun creating apps in Visual Studio... ================================ Free Android Apps: Click  links below to find out more: Excel Keyboard guide: https://play.google.com/store/apps/details?id=chrisjoms.myexcelapplicationguide Heaven's Dew Fall  Prayer app for Android : https://play.google.com/store/apps/details?id=soulrefresh.beautifu...

Add a remote folder in Linux

Adding a remote folder in Linux or basically mounting a folder in Linux system is quite easy. Like in copying and moving files or folder, it requires a source and a destination. A simple copy command in Linux is:   cp --source or any file to be copied--  --destination or where to copy the file-- In mounting a folder, using mount command does require also a source and a destination. man mount will display the available options for this command. Since source and destination is a pre-requisite in cp, mv or   mount command. In mounting a remote folder, the destination folder must be ready or created first before typing the mount command. Linux has default destination for mounting folder which is /mnt folder. Mounting a remote folder can be also done on other location such /home /usr or other preferred locations. To mount a folder in /mnt directory, a sub folder must be created first. To create a folder, type: mkdir /mnt/rem...

Outlook VBA search for string in email body

How to search for a string in the body of Outlook emails? How to search for a string in Outlook emails using VBA? How to find a string in Outlook email body using VBA? Outlook VBA code below searches a string on the email body and move the email to a specified folder. Replace variables below with the actual folders and string to search in Outlook: Destination_Folder_01 Folder_to_be_Searched string to be searched Folder_to_be_Searched - all emails in this folder will be searched and if the string matches the will be moved automatically to the destination folder.  string to be searched - this string will match on the body of the emails Sub MailItemContent_Move_Search() Dim olItem As Outlook.MailItem Dim sText As String Dim myNameSpace As Outlook.NameSpace Dim myInbox As Outlook.MAPIFolder Dim myDestFolder2 As Outlook.MAPIFolder Dim mySearchFolder As Outlook.MAPIFolder Set myNameSpace = Application.GetNamespace("MAPI") Set myInbox = my...

Linux folder with special characters

Operating system or even applications programs does restrict some characters since it's either used by the system or it is not permitted for some other reasons. In Linux special characters like ampersand, dashes and other special characters should not be used as folder names or even file names. But some users or even IT folks violate this rule without knowing the consequences it holds. Of course, whatever characters available on the keyboard should be used or else what's the point of having them on the keyboard. :) But there are consequences in using those mentioned characters. In Linux terminal, if the folder name has an ampersand on its folder name like the image below it cannot be copied easily. For example navigating in Linux through the terminal using "cd" should be smooth but sometimes simple things can be tough if you don't know how to get around with it. Navigating folders with special characters using "cd " command is quite sim...

Empty log or replace large files

Log files can easily occupy the space of a drive. If the log files is collecting or monitoring multiple system then chances are it will grow in size very quickly. If it the log file is in a text format, even if it comes in Giga or Tera bytes size it can be emptied very quickly in a command line. If the log files has been analyzed or not in use anymore, then it is a good candidate to get rid of it rather than occupy the space of a drive for nothing. To empty a log file or a text file: In Windows open command prompt and type: echo "First Line" > Packets_2018.log The log file will be replace with the word "First Line" and only a few bytes in size. Whatever was the content before on that log file is ditch away. So, be careful in emptying a file it's not reversible, In Linux open Terminal and type: echo "Line 1" > Packet_logstash.log Till next time..Cheers! ================================ Free Android Apps: ...