aspose file tools*
The moose likes Linux / UNIX and the fly likes Finding new line character or special characters in txt file ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Finding new line character or special characters in txt file ?" Watch "Finding new line character or special characters in txt file ?" New topic
Author

Finding new line character or special characters in txt file ?

kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1368
How to check(using script/command line) any new line character or special characters in the text file(.txt) in Unix/Linux.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11279
    
  59

What are you trying to achieve?

If all you want to do is count how many lines are in a file, you might want to look at the wc program.

If you want to be able to count specific characters, you might want to look at the grep command (take a look at the '--count' option).


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Andrew Monkhouse wrote:If you want to be able to count specific characters, you might want to look at the grep command (take a look at the '--count' option).

But grep counts matching rows, not characters.


http://home.arcor.de/hirnstrom/bewerbung
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Finding new line character or special characters in txt file ?
 
Similar Threads
Readin a txt file to populate into the database
Reading alarge file and wrapping content
interesting problem in char
How to store the newlines entered by enter key in textarea?
illegal space character