cut command in Linux with examples

The cut command in linux is a command for cutting out the sections from each line of files and writing the result to standard output. It can be used to cut parts of a line by byte position, character, and field. The cut command slices a line and extracts the text. It is necessary to specify an option with a command otherwise it gives an error.

[mai mult...]

Batch Script – Echo Command

In batch scripting, the echo command can be used to display a message, variable value, or system information on the console. The command can be followed by a message or text string enclosed in double quotes. For example, echo “Hello, World!” will display the message “Hello, World!” on the console.

Why use Batch Script – Echo Command?

Here are a few reasons why the echo command is commonly used:

  1. Displaying messages: The echo command can be used to display messages or information on the console or in a text file. This is useful for providing feedback to the user, displaying error messages, or providing instructions.
  2. Displaying variables: Batch scripts often use variables to store information or data. The echo command can be used to display the value of a variable on the console or in a text file, making it easier to debug and troubleshoot scripts.
  3. Debugging: The echo command can be used to debug scripts by displaying the values of variables, commands, or system information. This can help identify errors and improve the efficiency of scripts.
  4. File output: The echo command can be used to redirect output to a file, making it easier to save and share information. This can be particularly useful when generating reports or logs.
  5. Script automation: Batch scripts can automate repetitive tasks, making them more efficient and less prone to human error. The echo command can be used to provide feedback and ensure that scripts are running as expected.
[mai mult...]

Batch Script – Logging

Batch Script is a file that consists of various commands which need to be sequentially executed. It is not like coding and is not frequently used, in order to communicate with the OS through a command prompt, the user can use Batch Script. The commands are known as Batch commands.

Logging refers to the process of converting the command line scripts into .log files or text files. The command processor creates real-time activity logs which collect all the information regarding batch commands and statistics.

[mai mult...]

Batch Script – Input / Output

We are going to learn how to take input from users using Batch Script.

Taking User Input:

@echo off
echo Batch Script to take input.
set /p input= Type any input
echo Input is: %input%
pause

Explanation:

  • The first ‘echo’ command is used to print a string.
  • In the next line, ‘set  /p’ command is used to take user input followed by a variable that will hold user input.
[mai mult...]

Refresh Pivot Table Data in Excel

In the Pivot data table, data can be grouped based on Dates, Numbers, and Text values. In the case of dates, we can group dates by months or year, months by years, etc.

At any time, data for the PivotTables in your workbook can be refreshed using the Refresh button. You can also refresh data from a source table in the same or a different workbook.  By default, PivotTables are not refreshed automatically when data in the source table is changed, but you can set your workbook to refresh its PivotTable data automatically when you open it.

[mai mult...]