Skip to content

GREP to search for second column in a text file

I need to GREP second column (path name) from the text file. I have a text file which has a md5checksum filepath size . Such as: the above is the text file, I used grep -Eo ‘[/]’ file.txt but it prints only / , but i want the output like this: Lastly I have to use GREP. Answer If you

Shell Script to extract only file name

I have file format like this (publishfile.txt) I just want to extract the name OMEGA****, sample, sample(1) How can I do that I have used basename in my code but it doesn’t work in for loop. Here is my sample code But this code also doesn’t wor when used outside for loop Answer This simply says th…

Filling empty spaces in a CSV file

I have a CSV file where some columns are empty such as How do I replace all the empty columns with the word “empty”. I have tried using awk(which is a command I am learning to use). I want to have I tried to replace just the 3rd column to see if I was on the right track this left