Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Data manipulation using shell

$
0
0
Dear all

I have a dataset (in text format,delimited by tab) which have 100 variables (say, var0-var99) and more than 100,000 observations. I want to do the following:

1. for variable var0-var49, I want to add "00" in front of each data (for example, "1" would become "001")

2. for variable var50-var99, I want to add an underscore _ in front of each data (for example, "1" would become "_1")

How should I write the script?

Viewing all articles
Browse latest Browse all 16232

Trending Articles