answersLogoWhite

0


Best Answer

Look at the "wc" command's man page, it will give you a count of all characters, including the newline character.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: To count the number of characters in the given text file in unix?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What does wc mean in ubuntu?

wc is the word count utility. wc <file name> would return four values number of lines, number of words, number of characters, filename of the file processed


By using awk programming how to count number of lines in a given file without wc command?

Use the following:awk 'END { print NR }'Awk will count the lines and print it out.


Write a shell script to count the number of times is appears in a given text file?

You don't need a shell script to do this; use the 'grep' command with the '-c' option to count the number of occurrences of some pattern.


How do you find the no of characters and numerics in the given string?

First of all numbers are not meant to be stored in a string and if u do so in C, these numbers will be treated as characters and you can not perform any calculation on these numbers, and to find the number of characters in a string use the strlen() from the string.h file.


What is a data file that uses the same number of characters for each field in a data called?

It can be called a Fixed-Length file.


The term given to an asterisk or other character used to substitute for several characters in a file search?

Wild card


How do you write a c program that counts number of blanks in a text file using standard io?

int count_whitespace (FILE* input) { int c, count=0; while (( c = getc(input) ) != EOF ) if ((char) c==' ') ++count; return count; }


What characters can file names contain?

a file name can contain any type of character, it can be start from any character,number& can start with symbol also.


How many characters can be in a file name using Windows 95?

Windows 95 supported file names up to 255 characters in length.


How do you find number of words in a file NOTE if there is more than one space between the words in the file it should not consider tat as a word?

count very carefully. . .


What is the c program to count the no of digits in the given file?

Open the file for reading then traverse the file one character at a time. Each time you encounter a character within the range '0' through '9', increment a zero-initialised counter. When you reach the end of the file, close the file and return the counter value. int count_digits (const char* fname) { // Returns -1 on error (test global errno for system-specific errors). FILE* f; int count; char c; // Open file for read-only access (text-mode by default). FILE* f = fopen (fname, "r"); if (f==NULL) return (-1); count = 0; // Read and test each character, incrementing the count whenever the character is a digit. while (fscanf (f, "%d", &c) == 1) if (c>='0' && c<='9') ++count; fclose (f); return count; }


How many charicters can a DOS file have?

A DOS file, or .bat file can have unlimited characters.