I need to parse a text file in shell scripting
---
|
Quote:
whenever you post sample data or code you should use code-tags. The data you provided looks quite messy. Are the columns really separated by space or TAB? It is easy to achieve what you want if the data is TAB separated. Not so easy if it is in fact space separated. Please clarify on that and post some representative sample data. |
Assuming the fields are TAB separated...
Awk: Code:
awk -F"\t" 'NR > 1 {print "Channel Name :", $1, "; Service Handle :", $2, "; Package Name :", $3, "; BSG Handle :", $4, "; Package_tier :", $5}' file Code:
#!/bin/bash |
So did I miss something? Why has the OP pulled the question??
|
Mah! I have seen many situations like this and still I cannot understand the reasons for such a rude behavior. If the OP returns it's ok, otherwise this thread is eligible for closure. Nuff' said.
|
All times are GMT -5. The time now is 01:48 AM. |