Sponsored Content
Full Discussion: Problem in split command
Top Forums UNIX for Dummies Questions & Answers Problem in split command Post 73831 by superprogrammer on Monday 6th of June 2005 01:25:53 AM
Old 06-06-2005
Well, thanks for the responses
I need to split the file in 20K (20,000) records, not in 20K size
Jim I really dont understand what that od does

Last edited by superprogrammer; 06-06-2005 at 02:45 AM..
 

10 More Discussions You Might Find Interesting

1. 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

2. UNIX for Advanced & Expert Users

Split Command options

HI! All iam using Split command to split a large .txt file in to smaller files, The syntax iam using split -25000 Product.txt iam getting four output files but not in .txt format but in some other format , when i checked the properties the Type of the output files is Type can any... (7 Replies)
Discussion started by: mohdtausifsh
7 Replies

3. UNIX for Dummies Questions & Answers

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 (3 Replies)
Discussion started by: ChicagoBlues
3 Replies

4. Shell Programming and Scripting

split file problem

Hi All, I have a parent file with 10 million records. I want to split the parent file in to child files. Each child file contains 5000 records. I am using the following command for splitting: split -5000 parentfile.txt childfile.1 It will split the Parent file as... (7 Replies)
Discussion started by: hanu_oracle
7 Replies

5. 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

6. Shell Programming and Scripting

problem with awk for file split

Hi all, i have a .ksh script which is, among other stuff, splitting a file and saveing the filenames into variables for further processing: # file split before ftp and put result filenames into variables if ]; then awk '{close(f);f=$1}{sub("^","");print > f".TXT"}' $_ftpfile set B*.TXT... (0 Replies)
Discussion started by: spidermike
0 Replies

7. UNIX for Dummies Questions & Answers

change split with another command

hi all, i have problem with my script in unix ...i have script with split -d (--numeric-suffixes) in linux its working but in solaris machine the option -d isn't have so how to i can change split -d (this output) will same in output solaris can i change with awk and how do that thx before (2 Replies)
Discussion started by: zvtral
2 Replies

8. 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

9. UNIX for Beginners Questions & Answers

Urgent..!!Split command

Hi All, I want to split the file after size gets above 100kb. So I am using below command. split -b 100kb File.txt Test But after first file, my record is breaking as in middle of the record, size of file is getting above 100kb. So after splitting half record is in one file and half... (1 Reply)
Discussion started by: Amey Dixit
1 Replies

10. 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
chfile(8)						      System Manager's Manual							 chfile(8)

NAME
chfile - changes attributes of AdvFS files SYNOPSIS
/usr/sbin/chfile [-l on | off] [-L on | off] filename... OPTIONS
Enables or disables (on | off) forced synchronous write requests to the specified filename. By default, forced synchronous write requests to a file are off. Enables or disables (on | off) atomic-write data logging on the specified filename. By default, atomic-write data log- ging is off. OPERAND
One or more file names. DESCRIPTION
The chfile command lets you view or change the I/O mode that will be used when write requests are made to the file. There are three set- tings for this I/O mode: The default setting. Write requests are cached, the write system call returns to the calling program, and later (asynchronously), the data is written to the disk. When this mode is enabled, write requests to a file behave as if the O_SYNC option had been set when the file was opened. The write system call returns a success value only after the data has been successfully written to disk. When this mode is enabled, write requests to a file are asynchronous and written to the AdvFS log file. Should a system crash during or after a write system call, only complete write requests (up to 8192 bytes; see restrictions below) will be processed. This atomic operation guarantees that all (or none) of a write buffer will be in the file. For example, if a write of an 8192-byte buffer was started and, during the write system call or shortly thereafter, the system crashed, when the system was rebooted, either the entire 8192 bytes of data or none of it would have been written to the file. There would be no chance that some (but not all) bytes of the write request would be in the file. When AdvFS atomic-write data logging is enabled on a file, writes to the file are guaranteed to be flushed to disk in the order that they are written by the application. This is generally not guaranteed to be the case in POSIX-compliant file systems when files are opened in asynchronous mode. For example, the following code does three writes to a file: open(file); write(buffer A); write(buffer B); write(buffer C); close(file); If the file being written to did not use atomic-write data logging, and if the file were opened for asynchronous writes, then it is possible that buffer C would be written to disk before buffer B, that buffer B would be written to disk before buffer A, and so on. This might lead to confusing file contents if the system were to crash while the application was running. But if atomic-write data logging is used, even if the file is open for asynchronous writes, the buffers would be guaranteed to be written to disk in the order in which the application wrote them. The -l and -L options are mutually exclusive. You cannot simultaneously enable both forced synchronous writes and atomic-write data log- ging on a file. However, you can override the current I/O mode for a file. For example, you can change a file's I/O mode setting from forced synchronous writes to atomic-write data logging by using the chfile -L on command. If you do not specify the options, the command displays the current state of the file's I/O attribute. The chfile command can be used on AdvFS files that have been remotely mounted across NFS. You can run the chfile command on an NFS client to examine or change the I/O mode of AdvFS files on the NFS server. NOTES
Enabling atomic-write data logging for a file will retard performance because the data is written to both the user file and the AdvFS log file. Enabling forced synchronous writes to a file also can retard system performance. RESTRICTIONS
To use the chfile command on AdvFS files that are mounted across NFS, the NFS property list daemon, proplistd, must be running on the NFS client and the fileset must have been mounted on the client using the proplist option. Only writes of up to 8192 bytes are guaranteed to be atomic for files that use atomic-write data logging. Writes that are greater than 8192 bytes are written in segments that are at most 8192 bytes in length with each segment an atomic-write. If an error should occur (disk full, ulimit, and so on), the return value from the write will specify how much was successfully written. When writing to an AdvFS file that has been mounted across NFS, a further restriction applies: the offset into the file of the write must be on an 8K page boundary because NFS performs I/O on 8K page boundaries. The showfile command does not display the I/O mode for files that are mounted across NFS. To display the I/O mode of these files, use the chfile command. Usually AdvFS, when operating on small files that do not have a size that is a multiple of 8K, puts the last part of the files (their frags) into a special metadata file called the fileset frag file as a way to reduce disk fragmentation. For example, a file that does not use atomic-write data logging and has had 20K of data written to it will occupy 20K of disk space (as displayed by the du command). Files that use atomic-write data logging are exempt from this behavior. As a result, they always have a disk usage (as displayed by the du command) that is a multiple of 8K. For example, a file that has atomic-write data logging enabled and has had 20K of data written to it occupies 24K of disk space. If a file has a frag, an attempt to activate atomic-write data logging on it will fail. Files that use atomic-write data logging cannot be memory-mapped through the mmap system call. The error ENOTSUP is returned if the attempt is made. If a file has been memory-mapped through the mmap system call, an attempt to active atomic-write data logging on it fails with the same error. EXIT STATUS
The utility returns a 0 (zero) on success and a 1 (one) on failure. EXAMPLE
The following example queries the file I/O mode. # ls -l total 8712 drwx------ 2 root system 8192 Nov 4 06:16 .tags -rwxr-xr-x 1 root system 8435752 Nov 5 08:43 data_logging_file -rw-r--r-- 1 root system 250880 Nov 5 08:44 forced_sync_file -rw-r--r-- 1 root system 195320 Nov 5 08:44 normal_async_file -rw-r----- 1 root operator 8192 Nov 4 06:16 quota.group # chfile data_logging_file I/O type = atomic write data logging # chfile forced_sync_file I/O type = forced synchronous writes # chfile normal_async_file I/O type = normal asynchronous writes You can display similar information with the showfile command: # showfile data_log- ging_file forced_sync_file normal_async_file Id Vol PgSz Pages XtntType Segs SegSz I/O Perf File 8.8001 1 16 1030 simple ** ** ftx 100% data_logging_file 7.8008 2 16 31 simple ** ** sync 100% forced_sync_file 6.8001 1 16 24 simple ** ** async 100% normal_async_file The following code fragment queries the current I/O mode for an AdvFS file: . . . advfs_opT myop; int fd; int io_mode; . . . myop.version = ADVFS_OP_CURR_VERSION; myop.operation = ADVFS_AW_DATA_LOGGING; myop.action = ADVFS_GET_INFO; myop.info_buf = &io_mode; myop.info_buf_size = sizeof(int); ret = fcntl(fd, F_ADVFS_OP, &myop); if (ret) { perror("fcnt1 failed"); if (io_mode == ADVFS_ASYNC_IO) printf("I/O mode is asynchronous. "); else if (io_mode == ADVFS_DATA_LOGGING_IO) printf("I/O mode is atomic write data logging. "); else if (io_mode == ADVFS_SYNC_IO) printf("I/O mode is forced synchronous writes. "); SEE ALSO
Commands: showfile(8) Files: advfs(4) chfile(8)
All times are GMT -4. The time now is 02:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy