Questions tagged as 'awk'

2
answers

Copy everything before the first blank line

I have a file with several blocks of text separated by a blank line. Ex.: block1 block1 block2 block3 block3 I need a solution with sed, awk or perl that finds the first blank line and redirects the previous block to another file a...
asked by 11.12.2015 / 19:34
2
answers

Regular expression AWK print inside brackets

look, inside my.txt file has the following description: Flags: X - disabled, E - established 0 E name="peer1_cymru" instance=default remote-address=38.xx.xx.xx remote-as=65555 tcp-md5-key="WUf4f8" nexthop-choice=default multihop=ye...
asked by 07.07.2017 / 17:46
2
answers

Handling dates in AWK scripts

CONTEXT: I have a CSV file from which I want to extract and process some columns. I realized that AWK would be the perfect tool for this and everything went well until I had to deal with timestamps - for example 2008-07-31T21: 42: 52.667...
asked by 07.08.2014 / 17:26
2
answers

Remove all line breaks from only one column of a csv file on Linux

I have a csv file with more than 500k of rows and need to remove row breaks from just one column in an efficient way besides exclude all the links that contain it, an excerpt from the file: "created_at","text","location","name","screen_...
asked by 07.03.2017 / 01:08
1
answer

Four different conditions using awk if (unix)

Hello I need to do an awk if command using 4 different conditions together, example of my input only for a few lines (I have an input with thousands of lines) chr17_30 1 chr1_72 0 chr1_46 2 chr1_47 -1 chr1_48 1 Output desirable c...
asked by 25.09.2015 / 14:58
2
answers

How to print global IPv6 using grep and awk?

There are already a few days that I am searching the Internet for such a response but I have not gotten any so far. I'm trying to figure out ifconfig's Global IPv6 to be used on MOTD on Ubuntu. With IPv4 it was quite easy to do this with this...
asked by 16.02.2017 / 15:34
3
answers

Transform date format DD / MM / YY in MM / DD / YY in Shell Script

The script reads the date of a .txt in DD / MM / YY format, and needs to convert it to MM / DD / AA format with Bash, Sed, or AWK.     
asked by 14.10.2016 / 00:12
2
answers

Insert string in first column

I'm breaking my head with something very simple, I need to insert a ";" (semicolon) after a sort / uniq in a file. As the number of repeated rows returns, I need this return that is always in the first column to be inserted this ";". I already s...
asked by 03.03.2017 / 20:32
1
answer

Creating a file from a list and several different files

I have a list of names and several different files that may or may not contain all the names in the list and a value assigned to the names. I need to compare the values of all these each file to the names in the list. These are the kind of txt f...
asked by 05.05.2017 / 22:45
2
answers

Linux - Edit multiple files using another file as source

I have a file (listname.txt) with multiple names, one per line. I need to edit or remove all names that are in listanome.txt from various other files With grep I guess which files should be dictated, but are many. grep -Ff lista...
asked by 18.07.2018 / 20:03