filenames from split command


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers filenames from split command
# 1  
Old 11-11-2008
filenames from split command

Is there an option or a way with the split command to rename the partitioned files with a counter. For example, can the files testaa, testab, testac be renamed to test1, test2, test3 from the split command without explicilty renaming files.

Thanks,

- CB
# 2  
Old 11-11-2008
Try man csplit -

The csplit command writes the segments to files xx00 . . . xx99, depending on how many times the Argument parameter is specified (99 is the maximum).

I checked man on split - didn't have a similar option.
# 3  
Old 11-11-2008
So let's say I have a file test.dat with four records and I want to split it into 2 partitions. What is the syntax of csplit in this case.

Thanks,

- CB
# 4  
Old 11-11-2008
Hi.

The GNU/Linux version of split allows numeric:
Quote:
-d, --numeric-suffixes
use numeric suffixes instead of alphabetic

-- excerpt from man split, version split (coreutils) 5.2.1
I did not see that the split in HP-UX B.11.00 or Solaris 10 had those options.

If one is ambitious, there is a perl version of split at http://search.cpan.org/src/CWEST/ppt...split.lafferty which one could modify to do whatever one wants ... cheers, drl
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Help with Split Command

Hi All, I have a txt file which I would like to partition into 2 separate output files. I would like to partition the odd or even groups of 4 lines from the txt file. So I would like lines 1-4 to go to file1, and lines 5-8 to go to file2, and so on until the whole txt file is divided into two... (1 Reply)
Discussion started by: landrjos
1 Replies

2. Shell Programming and Scripting

Want to split awk command

Hi, There is an awk command in script and it is running successfully. I want to split that command in 2 lines. I have tried using '\' but its not working.. Please suggest me the solution. (11 Replies)
Discussion started by: Sanket Dalvi
11 Replies

3. UNIX for Dummies Questions & Answers

Split command

Hi I have a sequence which looks like this # PH01000000 PH01000000G0240 P.he_genemodel_v1.0 CDS 120721 121773 . - . ID=PH01000000G0240.CDS;Parent=PH01000000G0240 PH01000001G0190 P.he_genemodel_v1.0 mRA 136867 137309 . - . ID=PH01000001G0190.mRNA;Parent=PH01000001G0190... (7 Replies)
Discussion started by: siya@
7 Replies

4. UNIX for Dummies Questions & Answers

ls command with wild card can't return filenames starting with dot

I came across the following behaviour in Solaris 10 (x86-64bit) and RHEL 5.6 (Tikanga) -a option in ls command is supposed to list all files starting with a dot. From the man page of ls -a, --all do not ignore entries starting with . $ touch .mytestfile $ vi .mytestfile $... (2 Replies)
Discussion started by: kraljic
2 Replies

5. Solaris

How to get the filepath and filenames in pfiles PID command?

Hi, When I use pfiles PID, it displays the below output and i just see the inode, can i able to get the full path and file name? pl help me on this. Current rlimit: 8192 file descriptors 0: S_IFCHR mode:0620 dev:308,0 ino:12582968 uid:1001378434 gid:7 rdev:24,26 O_RDWR ... (3 Replies)
Discussion started by: balamv
3 Replies

6. UNIX for Advanced & Expert Users

split command

./myapp | split -b 10m -d -a 1 - "myappLog" here split command is reading the input from the output of myapp and it will write the text in to file where in each file size is 10MB and it will create upto 10 files. I have observed split is flushing the data for every 4096 bytes. if my... (7 Replies)
Discussion started by: arv600
7 Replies

7. Shell Programming and Scripting

awk help with find command and filenames with spaces

I have the following code: find /usr/local/test5 -type f -mtime +30 -exec ls -l {} \; | awk '{print $5, $6, $7, $8, $9}' I have this as output: 14 Aug 12 00:00 /usr/local/test5/file1 14 Aug 12 00:00 /usr/local/test5/lastname, The bolded part is where I run into trouble. The actual... (4 Replies)
Discussion started by: streetfighter2
4 Replies

8. Solaris

feeding filenames to find command

Hi, I am having set of files whose names are stored in a file say "filelist.txt" Now, I want to find all files contained in "filelist.txt" from my parent directory. Is there any way to let find command understand "filelist.txt" just like we have option -f in awk. I donot want to run a... (4 Replies)
Discussion started by: sanjay1979
4 Replies

9. UNIX for Advanced & Expert Users

Split Command in Perl

Hi, I have to split a line of the form 1232423#asdf#124324#54534#dcfg#wert#rrftt#4567 into an array in perl. I am using @fields; @fields=split('#',$line); if($fields eq "1") But this is not working. By using the syntax, the statements in "if" are never executed. Please help.... (9 Replies)
Discussion started by: rochitsharma
9 Replies

10. Shell Programming and Scripting

Split command

Can anyone tell me what this command will do? split -b$SPLITSIZE - $file1 < $file2 Will it split file1 or file2? Please explain. Malay (1 Reply)
Discussion started by: malaymaru
1 Replies
Login or Register to Ask a Question