Search Results

Search found 3 results on 1 pages for 'user150674'.

Page 1/1 | 1 

  • SHELL OR PERL QUESTION

    - by user150674
    I have a very large file, named 'ColCheckMe', tab-delimited, that you are asked to process. You are told that each line in 'ColCheckMe' has 7 columns, and that the values in the 5th column are integers. Using shell functions indicate how you would verify that these conditions were satisfied in 'ColCheckMe' K got this... nawk ‘ NF != 7 { Printf(“[%d] has invalid [%d] number of fileds\n”, FNR, NF) } $5 !~ /^[0-9]+$/ { Printf(“[%d] 5th field is invalid [%s]\n”, FNR, $5) }’ ColCheckMe Now, 2. In with the similar file, you are told that each value in column 1 is unique. How would I verify that? Also write a shell function that counts the number of occurrences of the word “SpecStr” in the file 'ColCheckMe' Any one can help in SHELL or everything including the first in PERL Scripting.

    Read the article

  • how to do this in shell

    - by user150674
    I have a very large file, named 'ColCheckMe', tab-delimited, that you are asked to process. You are told that each line in 'ColCheckMe' has 7 columns, and that the values in the 5th column are integers. Using shell functions indicate how you would verify that these conditions are satisfied in 'ColCheckMe' if In the same file, each value in column 1 is unique. How would I verify that? Also how to write a shell function that counts the number of occurrences of the word “SpecStr” in the file 'ColCheckMe' I tried the first part which checks for the valid number of field and checks the 5th field being integer field. nawk ' NF != 7 { printf("[%d] has invalid [%d] number of fields\n", FNR, NF) } $5 !~ /^[0-9]+$/ { printf("[%d] 5th field is invalid [%s]\n", FNR, $5) }' ColCheckMe now i wanna verify in the same file if the value in column 1 is unique. Also is there a way to write a shell function to count the occurrences of the world "SpecStr" in the file 'ColCheckMe' Thanks a lot

    Read the article

1