{"id":21593614,"url":"https://github.com/University-Experience/Regex-AWK","last_synced_at":"2025-07-17T01:31:50.071Z","repository":{"id":243192553,"uuid":"773864647","full_name":"BaraSedih11/Regex-AWK","owner":"BaraSedih11","description":"Distributed Operation Systems Lab2","archived":false,"fork":false,"pushed_at":"2024-03-18T15:01:20.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-07T09:11:28.974Z","etag":null,"topics":["awk","docker","linux","regex","regular-expression","ubuntu"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BaraSedih11.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-18T14:33:22.000Z","updated_at":"2024-06-07T09:11:30.527Z","dependencies_parsed_at":"2024-06-07T09:11:30.292Z","dependency_job_id":"4ce6bab8-d58c-4b9e-a2a9-b3d60388750a","html_url":"https://github.com/BaraSedih11/Regex-AWK","commit_stats":null,"previous_names":["barasedih11/regex-awk"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaraSedih11%2FRegex-AWK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaraSedih11%2FRegex-AWK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaraSedih11%2FRegex-AWK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaraSedih11%2FRegex-AWK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaraSedih11","download_url":"https://codeload.github.com/BaraSedih11/Regex-AWK/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226193696,"owners_count":17588179,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["awk","docker","linux","regex","regular-expression","ubuntu"],"created_at":"2024-11-24T17:13:42.374Z","updated_at":"2025-07-17T01:31:44.771Z","avatar_url":"https://github.com/BaraSedih11.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"  # Regex-AWK Lab\n\n  ## Introduction\n  In this lab, You will gain practical knowledge in working with Regular Expressions and some command-based data processing tools like AWK. You will work on the given simple text file (data.txt) and use linux to process the file to answer some required queries.\n\n  ## Lab requirements:\n  * You must have linux or WSL to run the commands on the terminal\n  * Learn regular expression (Regex) and finish this tutorial \u003ca href=\"https://regexone.com/\"\u003ehere\u003c/a\u003e\n  * Gain lots of skills working with AWK from this article (until lession number 13 at least) \u003ca href=\"https://linuxhandbook.com/awk-command-tutorial/\"\u003ehere\u003c/a\u003e\n  * Try to work with AWK on this interactive tutorial \u003ca href=\"https://n8ta.com/projects/awk.html\"\u003ehere\u003c/a\u003e\n\n  # Steps to start:\n  1- Go to your working directory:\n  \n  ```bash\n  cd \u003cyour working dirctory Ex. 'cd C:\\docker'\u003e\n  ```\n  2- create a text file (data.txt for example) and insert the data we will work on:\n  \n  ```bash\n  nano data.txt\n  ```\n  Then paste the data instide this file and press \"ctrl+o\" then \"enter\" then \"ctrl+x\" to exit\n  \n  3- To view the data:\n  \n  ```bash\n  cat data.txt\n  ```\n  ![image](https://github.com/BaraSedih11/Regex-AWK/assets/98843912/44eef754-a86f-4c12-94b1-af4774e872e2)\n\n  Now you are ready to work on the quests ⚡✅\n\n  ## Quests:\n  a-\tPrint only the first and last names of all the clients (there must be a space between first and last names):\n  \n  It can be done in two ways: \n\n  ```bash\n  awk '{print $1, $2}' data.txt\n  ```\n  ```bash\n  awk '{print $1 \" \" $2}' data.txt\n  ```\n\n  ![image](https://github.com/BaraSedih11/Regex-AWK/assets/98843912/28e29847-1cd4-408c-a946-d3e578147e37)\n\n\n  b-\tSame as above but print the names are in reverse order (last name, first name) and make sure there is a comma between last name and first name:\n\n  It can be done like this:\n\n  ```bash\n  awk '{print $2 \",\" $1}' data.txt\n  ```\n  ![image](https://github.com/BaraSedih11/Regex-AWK/assets/98843912/ffda920e-77b0-4c48-b52a-0c6a00ee24b9)\n\n  c-\tPrint only first name and last name (without header that has the names of the columns: first name, last name, etc):\n\n  It can be done like this:\n\n  ```bash\n  awk 'NR\u003e1 {print $1, $2}' data.txt\n  ```\n\n  ![image](https://github.com/BaraSedih11/Regex-AWK/assets/98843912/5836abbe-4cbf-40fb-a64f-fa82ed3c84c0)\n\n  d-\tSame as above but with numbers indicating the client's order:\n\n  It can be done like this:\n\n  ```bash\n  awk 'NR\u003e1 {print NR-1, $1, $2}' data.txt\n  ```\n\n  ![image](https://github.com/BaraSedih11/Regex-AWK/assets/98843912/2abeba73-5526-4d35-9fae-9a09b046a14d)\n\n  e-\tPrint first and last names of customers who are more than 50 years old:\n\n  It can be done like this:\n\n  ```bash\n  awk 'NR\u003e1 \u0026\u0026 $4 \u003e 50 {print $1, $2}' data.txt\n  ```\n\n  ![image](https://github.com/BaraSedih11/Regex-AWK/assets/98843912/49d14327-e29f-4ce6-b3af-63e7353741a1)\n\n  f-\tPrint the first and last names of customers who own more than 10000$:\n\n  It can be done like this:\n\n  ```bash\n  awk 'NR\u003e1 \u0026\u0026 $5 \u003e 10000 {print $1, $2}' data.txt\n  ```\n\n  ![image](https://github.com/BaraSedih11/Regex-AWK/assets/98843912/cc04217a-4cc3-4101-992c-d6bee15ae0f8)\n\n  g-\tPrint the total sum of all money in all the accounts:\n\n  It can be done like this:\n\n  ```bash\n  awk '{sum += $5} END {print sum}' data.txt\n  ```\n\n  ![image](https://github.com/BaraSedih11/Regex-AWK/assets/98843912/4b4077f5-e035-4bf3-b03c-37ffd6bdf528)\n\n  h-\tPrint all the information of all accounts whose owner's first name is Chad. (hint. use REGEX):\n\n  It can be done like this:\n\n  ```bash\n  awk '$1 ~ /^Chad$/ {print}' data.txt\n  ```\n\n  ![image](https://github.com/BaraSedih11/Regex-AWK/assets/98843912/3e4c04c3-760f-4800-9996-d194f0665f78)\n\n  i-\tPrint all the information of all accounts whose owner's last name ends with the letter r (hint: REGEX):\n\n  It can be done like this:\n\n  ```bash\n  awk 'NR\u003e3 \u0026\u0026 $2 ~ /r$/ {print}' data.txt\n  ```\n\n  ![image](https://github.com/BaraSedih11/Regex-AWK/assets/98843912/560b88d1-5a18-45a9-930a-3b75aabf9398)\n\n  j-\tPrint all the information of all accounts whose owner age has the number for the first and 2nd digits:\n\n  It can be done like this:\n\n  ```bash\n  awk '$4 \u003e= 10 \u0026\u0026 int($4/10) == $4 % 10 {print}' data.txt\n  ```\n\n  ![image](https://github.com/BaraSedih11/Regex-AWK/assets/98843912/52307add-42ee-4996-9f1e-a5f4f10b77e4)\n\n  ## Congratulations 🥳💥\n  You've completed this lab, I hope you find it helpful, follow me on my github profile to learn more exciting things ⚡💻\n\n\n\n\n\n\n\n\n\n\n  \n\n  \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FUniversity-Experience%2FRegex-AWK","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FUniversity-Experience%2FRegex-AWK","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FUniversity-Experience%2FRegex-AWK/lists"}