spilit the list of files in set ls -1 *.dbf


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting spilit the list of files in set ls -1 *.dbf
# 1  
Old 06-18-2009
spilit the list of files in set ls -1 *.dbf

Dear All,
Please help in this subject..
my requirement is list the files in directory and out of that list make the different set and each should set contains 10 files and assign to variable and start zipping in background. pick the second set files and same to be repeat the commands parallel.
i used ls -1 *.dbf | head -10 to get the first set. and start the zip using gzip.


kindly help me how can i get the next 10 files and assign to second variable.
Appreciated u r help in advance..
Madhu
# 2  
Old 06-18-2009
You could pipe ls into the split(1) utility i.e
Code:
ls -l *.dbf | split -l 10

# 3  
Old 06-18-2009
Hi fpmurphy,

it worked ... but it generates random file name... is there any way so i can specify file name with file1...file2.. file3... like.

Thanks in advance.
Madhu
# 4  
Old 06-18-2009
check the split man page. you can put suffix/prefix
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help needed with shell script to search and replace a set of strings among the set of files

Hi, I am looking for a shell script which serves the below purpose. Please find below the algorithm for the same and any help on this would be highly appreciated. 1)set of strings need to be replaced among set of files(directory may contain different types of files) 2)It should search for... (10 Replies)
Discussion started by: Amulya
10 Replies

2. UNIX for Advanced & Expert Users

Find the list of files with a set of Users

Hello all, I want to find the files for certain users. I cant make the or condition work in this instance. I've tried the code below but it didnt worked. Any input on how to get the list for all files for this users. find . -type f -user abc134 -o -user xyz345 -o bce483 -exec ls... (6 Replies)
Discussion started by: sethmj
6 Replies

3. Shell Programming and Scripting

Want to do this: cp *1.dbf *2.dbf

This is not a valid command, but you get the idea: "cp *1.dbf *2.dbf" I need to change the 1 to 2 on many file names. Using csh. Any ideas? MM (3 Replies)
Discussion started by: MartMX
3 Replies

4. UNIX for Advanced & Expert Users

Advance file_name serech from set of list files in particular directory

Hi All, im hav one requirement, let me explain my requirement. my script will run every one hour and it wil pull files from remote server to my local server.but the d files hwich are pulled my not be in required format wht im expecting in my server. but in my sever in particular dierectory i... (7 Replies)
Discussion started by: Seshendranath
7 Replies

5. Shell Programming and Scripting

Finding compound words from a set of files from another set of files

Hi All, I am completely stuck here. I have a set of files (with names A.txt, B.txt until L.txt) which contain words like these: computer random access memory computer networking mouse terminal windows All the files from A.txt to L.txt have the same format i.e. complete words in... (2 Replies)
Discussion started by: shoaibjameel123
2 Replies

6. Shell Programming and Scripting

how to spilit a row into fields and store the field content to the array

consider this is a line A#B#C#D#E#F#G#H note the delimeter is # i want to cut or spilt in to fields using the delimeter # and to store in an array. like this array=A array=B array=C array=D array=E and the array content should be displayed. echo "${array}" echo "${array}"... (5 Replies)
Discussion started by: barani75
5 Replies

7. Shell Programming and Scripting

how to read dbf file in shell script and to convert dbf file usinf shell script

Hi all, I am new to shell scripting. I have dbf file and I need to convert it into csv file. OR, can i read the fields from a .dbf file and OR seprate the records in dbf file and put into .csv or txt. Actually in the .dbf files I am getting , the numbers of fields may vary in very record and... (6 Replies)
Discussion started by: gauara
6 Replies

8. UNIX for Advanced & Expert Users

ascii to dbf HELP!

Hi, Does anyone know of an ascii to dbf converter for sco unix? Or any flavor of unix for that matter. Thanks! Georgio (1 Reply)
Discussion started by: gseyforth
1 Replies
Login or Register to Ask a Question