Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ltrim(), rtrim(), and trim() in awk
function ltrim(s) { sub(/^[ \t\r\n]+/, "", s); return s }
function rtrim(s) { sub(/[ \t\r\n]+$/, "", s); return s }
function trim(s) { return rtrim(ltrim(s)); }
BEGIN {
# whatever
}
{
# whatever
}
END {
# whatever
}
@andyxning

This comment has been minimized.

Copy link

andyxning commented Aug 19, 2015

awesome!

@elgholm

This comment has been minimized.

Copy link

elgholm commented Sep 22, 2015

Thx!

@islamouahouda

This comment has been minimized.

Copy link

islamouahouda commented Mar 5, 2016

Thanks great work !

@michto01

This comment has been minimized.

Copy link

michto01 commented Nov 3, 2016

Thx!

@luisco

This comment has been minimized.

Copy link

luisco commented Jun 8, 2017

Excellent, thanks

@moijes12

This comment has been minimized.

Copy link

moijes12 commented Aug 26, 2017

Thanks 👍

@kdcc

This comment has been minimized.

Copy link

kdcc commented Feb 27, 2018

Fantastic! @

@RezoApio

This comment has been minimized.

Copy link

RezoApio commented Mar 5, 2018

Really useful! Thanks a lot

@noobbbbb

This comment has been minimized.

Copy link

noobbbbb commented Jul 31, 2018

Thx!

@Mrcooder

This comment has been minimized.

Copy link

Mrcooder commented Sep 10, 2018

Thank you very much, man.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.