0

Example:

$ cat 1.log 
1111 2222 3333
4444 5555 6666
7777 8888 9999

I need to add information in each column:

Example:

$ for i in $(cat 1.log | awk {'print $1'}) ; do echo "INFO: $i" ; done
INFO: 1111
INFO: 4444
INFO: 7777

Expected:

INFO: 1111 INFO1: 2222 INFO2: 3333
INFO: 4444 INFO1: 5555 INFO2: 6666
INFO: 7777 INFO1: 8888 INFO3: 9999

I would need the "echo"

1 Answer 1

1

$ awk '{print"INFO:"$1" INFO1:"$2" INFO2:"$3}' 1.log

Output:

INFO:1111 INFO1:2222 INFO2:3333
INFO:4444 INFO1:5555 INFO2:6666
INFO:7777 INFO1:8888 INFO2:9999
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.