Git Product home page Git Product logo

awk_examples's Introduction

Awk Examples

This repository provides a collection of examples illustrating how to use Awk for text processing and data manipulation.

Installation

Linux

Awk is typically pre-installed on most Linux distributions. You can verify its installation by running awk --version in your terminal.

Windows

For Windows users, this repository includes a Dockerfile to set up a Linux container where Awk is available.

Steps to create and run the Docker container:

  1. Open PowerShell.
  2. Navigate to the directory containing the Dockerfile.
  3. Run the provided PowerShell script to build and execute the Docker container:
./rundocker.ps1

Getting Started

The src folder contains sample scripts and data files for testing. You can generate CSV files using Excel or similar programs and then process them with Awk scripts.

To run an Awk script, navigate to the directory containing your script and execute it using the command below:

awk -f script_name.awk input_file.csv

Troubleshooting

Windows uses the carriage return and line feed (\r\n) as a newline character, while Unix/Linux uses just the line feed (\n). If your AWK script was created or edited in a Windows environment, you'll need to convert these line endings to Unix/Linux format for it to run correctly on Unix-like systems.

sed -i 's/\r$//' your_script.awk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.