Limits of FOR loop to go to end of File


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Limits of FOR loop to go to end of File
# 1  
Old 10-21-2008
Java Limits of FOR loop to go to end of File

Hi ALLSmilie,
I have a file for e.g.

ajdflkj|dkj|djfj|go|123|4||||||||||||||89|101|||||||||||||||

The length of file is not fixed. So wat the limits should be given in for loop to access till end of file????

Thanks in advance.....
# 2  
Old 10-21-2008
hi,

You need not to know the limit of the line in for loop in unix,

the syntax is simple

Code:
for line in $filename
     do
        echo $line
     done

Thanks
namish
# 3  
Old 10-21-2008
Thanks namish for quick reply, but i m having a single line file in which
ajdflkj|dkj|djfj|go|123|4||||||||||||||89|101|||||||||||||||

i want to store the fields(which are separated by pipe |) in an array n i dont know the end of file. So how long the loop should run??
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Soft and hard limits for nproc value in /etc/security/limits.conf file (Linux )

OS version : RHEL 6.5 Below is an excerpt from /etc/security/limits.conf file for OS User named appusr in our server appusr soft nproc 2047 appusr hard nproc 16384 What will happen if appusr has already spawned 2047 processes and wants to spawn 2048th process ? I just want to know... (3 Replies)
Discussion started by: kraljic
3 Replies

2. Shell Programming and Scripting

Help on Adding one counter loop at the end of each line in a file

Hello All, I have file a.txt I want to add a counter loop at the end of each line in a file ill explain: i have a site h**p://test.test=Elite#1 i want to add a a counter to the number at the end of the file, that it will be like this urlLink//test.test=Elite#1 urlLink//test.test=Elite#2... (3 Replies)
Discussion started by: nexsus
3 Replies

3. HP-UX

HP-UX 10.20 file size limits?

Hi, I'm running HP-UX 10.20. Is there a 2GB file size limit? if so, can i change it? (3 Replies)
Discussion started by: gabriel.560
3 Replies

4. Shell Programming and Scripting

End of file with while loop

(sh shell) I have a function I am using that does a date calculation so I can subtract dates. get_JD () { bc << MSG scale=0 date calculation ………....... MSG } Then I have this little script that runs after it. read XXX < TESTFILE pastdate=`get_JD $XXX` currdate=`get_JD &YYY`... (2 Replies)
Discussion started by: nickg
2 Replies

5. UNIX Desktop Questions & Answers

File size limits

I want to increase the file size, I am trying to store the output but it's not storing the whole output in to the file (7 Replies)
Discussion started by: navintsm
7 Replies

6. Shell Programming and Scripting

while loop to add text to the end of a file

Hi all, I've got 2 files. File 1 has a list say a b c d e f File 2 got start= What I want is to create File 3 which look like this start=a,b,c,d,e,f So is it possible to loop throught File1 to echo it into File3 in one line? (3 Replies)
Discussion started by: stinkefisch
3 Replies

7. Shell Programming and Scripting

for loop not working - syntax error at line 6: `end of file' unexpected

I have a file called test.dat which contains a b I have written a shell script called test.sh for i in `cat test.dat` do echo $i done When i run this script using sh test.sh I get this message - test.sh: syntax error at line 6: `end of file' unexpected What is the... (3 Replies)
Discussion started by: debojyoty
3 Replies

8. UNIX for Advanced & Expert Users

nawk - file limits

Hi, I want to search particular pattern and splitting the file in to multiple files. (Splitted files may be more than 150). It got splitted upto 20 files after that, I got some error. nawk: filename.21 makes too many open files. input record number 654, file xxxxxxx Can u guide me to... (1 Reply)
Discussion started by: sharif
1 Replies

9. UNIX for Dummies Questions & Answers

file number limits in Solaris 8

What is the kernel parameter ( or other) that sets the maximum number of open files by the o/s (3 Replies)
Discussion started by: blp001
3 Replies

10. UNIX for Dummies Questions & Answers

File Limits on Solaris 2.6

%ulimit -a nofiles(descriptors) 1024 This means that I can open up to 1024 file per process? But wonder if there is any hardlimit imposed by Solaris 2.6 (eg 255) ? By the way, is there any tool that can trace which files (or sockets) are opened by a process? Thanks DY (5 Replies)
Discussion started by: deaniyoer
5 Replies
Login or Register to Ask a Question