Finding EOL char is there or not in a big size file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Finding EOL char is there or not in a big size file
# 1  
Old 06-14-2006
Finding EOL char is there or not in a big size file

Hi,

I am using ksh.

I have to find wether data file has EOL or not. as per my knowledge we can easily find by checking each character. But this is a tedious job as per my requirement because my data file size is very big . It may be in 25-30 MB.
So please advice me how i can check wether data file has EOL or not.

Thanks in advance
# 2  
Old 06-14-2006
Quote:
Originally Posted by HariRaju
Hi,

I am using ksh.

I have to find wether data file has EOL or not. as per my knowledge we can easily find by checking each character. But this is a tedious job as per my requirement because my data file size is very big . It may be in 25-30 MB.
So please advice me how i can check wether data file has EOL or not.

Thanks in advance
If you want to check every line, you gonne have to parse the whole file,
or do you only want to check the first or last line ?
# 3  
Old 06-14-2006
i only want to check end of line
# 4  
Old 06-14-2006
I think you mix two things.
There is a EOL at the end of each line and there is something like EOF (end of file).
As far as i understand, you mean the EOF character, is this so ?
# 5  
Old 06-14-2006
grep -q 'character goes here' bigfile

Unix doesn't have an EOF character, and EOF condition for a file, yes.
EOL can mean a newline \n - but since the OP asked for EOL instead of newline, I don't know what is meant. I guess '\n'
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Finding size of files with spaces in their file names

I am running a UNIX script to get unused files and their sizes from the server. The issue is arising due to the spaces present in the filename/folder names.Due to this the du -k command doesn't work properly.But I need to calculate the size of all files including the ones which have spaces in them.... (4 Replies)
Discussion started by: INNSAV1
4 Replies

2. Shell Programming and Scripting

Help in finding & comparing avg file size

I have some files in a directory with two different extensions which get created everyday. Can you please help me out in getting the average file size for both these extensions and checking it with the last two file sizes of the same file extension ? To be more clear.. Lets say I have 10 files... (1 Reply)
Discussion started by: kiran1112
1 Replies

3. Shell Programming and Scripting

Formatting File having big single line into 95 Char Per Line

Hi All, I have 4 big files which contains one big line containing formatted character records, I need to format each file in such way that each File will have 95 Characters per line. Last line of each file will have newline character at end. Before:- File Name:- File1.dat 102 121340560... (10 Replies)
Discussion started by: lancesunny
10 Replies

4. Shell Programming and Scripting

Finding Last Occurance Of a Char

Hi, I need to fine out the Last occurance of / in the following out out. crontab -l | grep RMAN_VTL_Bkup.sh | tail -1 | awk '{print $6}' /oracle/PI1/software/RMAN/backup/RMAN_VTL_Bkup.sh Coudl you please let me know Thanking you inadvance, (8 Replies)
Discussion started by: kenal
8 Replies

5. Solaris

Search for big file size only in root fs

Hi all, I'm working on Solaris and quite often I receive the alert message of file system at 90%. I'd like to find which files caused this happens (at least the biggest files) with the following command: find . -size +10000000c -exec ls -larth {} \; This looks for every file in every fs... (4 Replies)
Discussion started by: Evan
4 Replies

6. UNIX for Dummies Questions & Answers

Help finding/adding up file size...

Ok, I am new to UNIX and Shell scripting and I am trying to do the following using a korn shell script: I have a large data file that is loaded into a database, this data file is split into parts to make it more manageable based on a size parameter. The file contains many account records, the... (1 Reply)
Discussion started by: Stove13
1 Replies

7. Programming

size of char array in c

i have to store a data more than 100000. i don't know the size of the data whether it may be 100000 or 1000000. so how can i define variable size; example char abc; but i don't know the size so how can i give array size?? in one sentence how can i give the array size dynamically so that i... (6 Replies)
Discussion started by: phani_sree
6 Replies

8. Shell Programming and Scripting

finding duplicate files by size and finding pattern matching and its count

Hi, I have a challenging task,in which i have to find the duplicate files by its name and size,then i need to take anyone of the file.Then i need to open the file and find for more than one pattern and count of that pattern. Note:These are the samples of two files,but i can have more... (2 Replies)
Discussion started by: jerome Sukumar
2 Replies

9. Shell Programming and Scripting

bash script working for small size files but not for big size files.

Hi, I have one file stat. Stat file contents are as follows: for example. H50768020040913,00260100,507680,13,0000000643,0000000643,00000,0000 H50769520040808,00260100,507695,13,0000000000,0000000000,00000,0000 H50770620040611,00260100,507706,13,0000000000,0000000000,00000,0000 Now i... (1 Reply)
Discussion started by: davidpreml
1 Replies

10. Programming

size of a char devices

hi i want to write a simple io-benchmark for raw devices, especially for harddisks, vx-volumes and md-volumes on solaris. is there a unix system call to get the size of the device? the 'stat' system call reports the size for regaular files but not for block or devices. On Solaris the... (2 Replies)
Discussion started by: guenter
2 Replies
Login or Register to Ask a Question