<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Revati</title>
    <description>The latest articles on DEV Community by Revati (@revati2706).</description>
    <link>https://dev.to/revati2706</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2205834%2F0fe18ec4-9232-44e3-882e-2ff02f79bd40.jpeg</url>
      <title>DEV Community: Revati</title>
      <link>https://dev.to/revati2706</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/revati2706"/>
    <language>en</language>
    <item>
      <title>Learning AWK: A Simple and Powerful Tool</title>
      <dc:creator>Revati</dc:creator>
      <pubDate>Sun, 20 Oct 2024 11:20:50 +0000</pubDate>
      <link>https://dev.to/revati2706/learning-awk-a-simple-and-powerful-tool-1hf6</link>
      <guid>https://dev.to/revati2706/learning-awk-a-simple-and-powerful-tool-1hf6</guid>
      <description>&lt;p&gt;After getting comfortable with Bash scripting, I was on the lookout for something that could handle data processing more efficiently. That’s when my mentor M Prashant introduced me to AWK. At first, I wasn’t sure I needed it—Bash was doing the job—but once I started using AWK, I realized how powerful it actually is.&lt;/p&gt;

&lt;p&gt;Here’s my journey of learning AWK, and why I think it’s worth your time if you work with data or text files regularly.&lt;br&gt;
What is AWK?&lt;/p&gt;

&lt;p&gt;AWK is a command-line tool that processes text files. It reads a file line by line, looks for patterns, and performs actions on lines that match. It sounds technical, but once I tried a few basic commands, it clicked. AWK is great when you need to filter, extract, or even transform data quickly.&lt;br&gt;
My First Steps with AWK&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Printing Everything:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;awk '{ print }' file.txt&lt;/p&gt;

&lt;p&gt;My first command in AWK! It just prints every line from the file. Simple, but a good starting point.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Printing Specific Columns:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;awk '{ print $1, $3 }' file.txt&lt;/p&gt;

&lt;p&gt;AWK splits lines into fields, so $1 is the first column, $3 is the third, and so on. This command let me print just the parts I needed, which was super handy for working with CSV files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Finding Specific Patterns:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;awk '/error/ { print }' log.txt

This was a lifesaver when I had to go through logs. It printed only the lines containing the word “error,” saving me a ton of time.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Why AWK is a Game-Changer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The real magic of AWK, for me, came when I realized how fast it handles data. For example, summing up numbers from a column is a task that would take a while in Bash, but AWK does it in one line:&lt;/p&gt;

&lt;p&gt;awk '{ sum += $2 } END { print sum }' data.txt&lt;/p&gt;

&lt;p&gt;In this case, it adds up all the numbers in the second column and prints the total. That’s when I thought, “Wow, this tool is powerful!”&lt;br&gt;
Handy AWK Tips I Use&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Changing Field Separators: Normally, AWK treats spaces as the separator between fields, but for CSV files, you can switch it to a **comma:**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;awk 'BEGIN { FS="," } { print $1, $3 }' file.csv&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Counting Lines:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;awk 'END { print NR }' file.txt&lt;/p&gt;

&lt;p&gt;This command prints the total number of lines in a file. It’s great when I need to check the size of a dataset.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Replacing Text:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;awk '{ gsub(/old/, "new"); print }' file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;AWK can quickly replace all occurrences of a word. I’ve used this to make quick edits to files without opening them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Learning AWK was a turning point for me. I went from thinking I didn’t need another tool to realizing how much time it saves when working with large files or complex data. Thanks to Prashant for pushing me to learn it! Now, I can’t imagine handling logs or CSVs without AWK.&lt;/p&gt;

&lt;p&gt;If you work with text data regularly, give AWK a try. It’s a bit of a learning curve, but once you understand the basics, it’ll become your go-to tool for fast and efficient data processing.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>My Experience Learning Bash Scripting as a Student</title>
      <dc:creator>Revati</dc:creator>
      <pubDate>Sun, 13 Oct 2024 14:33:14 +0000</pubDate>
      <link>https://dev.to/revati2706/my-experience-learning-bash-scripting-as-a-student-15gh</link>
      <guid>https://dev.to/revati2706/my-experience-learning-bash-scripting-as-a-student-15gh</guid>
      <description>&lt;p&gt;I recently started learning Bash scripting. I wanted to share a bit about why I decided to learn it and how it’s been helpful so far.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Learn Bash?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As a student, I’ve worked with Python, but I realized learning Bash could make my life easier when working with Linux systems and automating tasks like file organization or backups. Bash is great for handling these tasks directly from the command line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How I Learned&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Started small&lt;/strong&gt;: I began with basic commands like navigating directories and creating files.&lt;br&gt;
&lt;strong&gt;YouTube help&lt;/strong&gt;: &lt;strong&gt;M Prashant’s YouTube channel&lt;/strong&gt; was super helpful. His videos on Bash scripting are easy to follow, especially for beginners.&lt;br&gt;
&lt;strong&gt;Practice&lt;/strong&gt;: I wrote small scripts to automate simple tasks, like organizing files or setting reminders.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I’ve Gained&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Time saved: Automating tasks has made things quicker.
Better with Linux: I’m more comfortable using the terminal.
Confidence in scripting: I’m now writing scripts more easily.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If you’re just starting with Bash, I highly recommend checking out &lt;strong&gt;M Prashant’s YouTube channel&lt;/strong&gt;. Let me know if you have any questions or if you're learning Bash too!&lt;/p&gt;

&lt;p&gt;Happy coding! 😊&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
