kauschan
kauschan

Reputation: 486

how to cut in awk

I have a file as follows

100 sesCook=0ea4ce6259b087f5aec09934b3aab9fe4f0ee62d

100 sesCook=71e16fadaf9c5c57e7ef706a60f768bcffad7fc1

100 sesCook=a60cbaaed8349260783309a72c8bcdbd4d030255

100 sesCook=f8470d1272c4d9c1b69682260ed1b558c7a2dd55

101 sesCook=83b867a10e3d9d3b727d281548dcf6c29efb9382

101 sesCook=e7c4a834d57576d73e66883d7fbfbc8160125569

I want to have the first column as it is. However in the second column i want to cut all "sesCook=" and just have the pattern eg:

100 0ea4ce6259b087f5aec09934b3aab9fe4f0ee62d

100 71e16fadaf9c5c57e7ef706a60f768bcffad7fc1

100 a60cbaaed8349260783309a72c8bcdbd4d030255

100 f8470d1272c4d9c1b69682260ed1b558c7a2dd55

101 83b867a10e3d9d3b727d281548dcf6c29efb9382

101 e7c4a834d57576d73e66883d7fbfbc8160125569

How do i do this using awk or cut ?

Upvotes: 4

Views: 3651

Answers (1)

Mark McKinstry
Mark McKinstry

Reputation: 2626

sed would probably be a better tool:

sed -e 's|sesCook=||'

But if you really want awk, this will split it on the '=' sign:

awk -F'[[:space:]=]' '{print $1, $3}'

Upvotes: 7

Related Questions