Question: I have a file named "output.txt" having data in format:

```
400949703|2000025967912|20130614010652|20130614131543
355949737|2144050263|20120407100407|20120407101307
355499738|2144500262|20110911010901|20110911135601

```

I am executing an awk command as shown below:

```
awk -F"|" '{num1="`echo $3| cut -c1-8`"; print $num1}' output.txt

```

My expected output is :

```
20130614
20120407
20110911

```

But I am getting output as what is actually the input.

```
400949703|2000025967912|20130614010652|20130614131543
355949737|2144050263|20120407100407|20120407101307
355499738|2144500262|20110911010901|20110911135601

```

Not able to find out the reason. My task is to compare the 1st 8 characters in 3rd and 4th column. But stucked at this part only.

Experts, kindly help me to get the way, where I am missing.

Answer: 
I'd prefer to use code like this:

```
var demo = string.Join(
    ",", 
    Enumerable.Range(1, count)
        .Select(n => string.Format("\"{0}\"", n)));

```

Breaking it down a bit...

```
Enumerable.Range(1, count) //Gives a list of integers from 1 to count

.Select(n => string.Format("\"{0}"\"", n) //Surrounds each integer with double quotes

string.Join(...) //Joins the strings above using the comma

```
string template = "\"{0}\"";

```
        while (i < (count - 1))
        {
            string temp = null;
            if (i == 0)
            {
                temp = string.Format(template, arry[i]);
            }
            else
            {
                temp = "," + string.Format(template, arry[i]);
            }
            demo = demo + temp;
            i++;
        }

```