Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Split Command Generating Incomplete Output Files Post 303000625 by Ariean on Sunday 16th of July 2017 10:39:59 AM
Old 07-16-2017
Split Command Generating Incomplete Output Files

Hello All,
May i please know how do i ensure my split command would NOT generate incomplete output files like below, the last lines in each file is missing some columns or last line is complete.

Code:
split -b 50GB File File_

Code:
File_aa

|551|70210203|xxxxxxx|12/22/2010 20:44:58|11/01/2010 00:00:00||||||||1.0000000000||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||AD7678||||||||||||||||||||||||||||||||||xxxxxx||||||5034||e4mdevl1|07/14/2017 15:48:02||
|551|70220223|xxxxxxx|12/22/2010 20:44:58|11/01/2010 00:00:00||||||||1.0000000000||||||||||||

File_ab

|562|71654982|xxxxxx|11/22/2011 19:01:45|10/01/2011 00:00:00||||||||1.0000000000||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||AH6734||||||||||||||||||||||||||||||||||3xxxx||||||5034||e4mdevl1|07/14/2017 15:48:02||
|562|71655059|171348415

File_ac

|573|57162801|xxxxxx|10/24/2012 15:22:12|09/01/2012 00:00:00||||||||0.9965540000||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||AB0496||||||||||||||||||||||||||||||||||xxxxx||||||5034||e4mdevl1|07/14/2017 15:48:02||
|573|57162908|4004900159|10/

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk command to split in to 2 files

Hi, I have a problem in grepping a file for 2 strings and writing them to 2 appropriate files. I need to use the awk command and read the file only once and write to the appropriate file. My file is very huge in size and it is taking a long time using cat command and grep command. Can anyone... (3 Replies)
Discussion started by: m_subra_mani
3 Replies

2. Shell Programming and Scripting

Join of files is incomplete?!

Hi folks, I am using the join command to join two files on a common field as follows: File1.txt Adsorption|H01.181.529.047 Adult|M01.060.116 Children|M01.055 File2.txt 5|Adsorption|C0001674 7|Adult|C000001 6|Children|C00002 join -i -t "|" -a 2 -1 1 -2 2 File1.txt File2.txt This... (7 Replies)
Discussion started by: s0460205
7 Replies

3. Shell Programming and Scripting

How to ignore incomplete files

On Solaris & AIX, suppose there is a directory 'dir'. Log files of size approx 1MB are continuously being deposited here by scp command. I have a script that scans this dir every 5 mins and moves away the log files that have been deposited so far. How do I design my script so that I pick up... (6 Replies)
Discussion started by: sentak
6 Replies

4. Solaris

How to ignore incomplete files

On Solaris, suppose there is a directory 'dir'. Log files of size approx 1MB are continuously being deposited here by scp command. I have a script that scans this dir every 5 mins and moves away the log files that have been deposited so far. How do I design my script so that I pick up *only*... (6 Replies)
Discussion started by: sentak
6 Replies

5. UNIX for Dummies Questions & Answers

split files into specified number of output files

Hi everyone, I have some large text files that I need to split into a specific number of files of equal size. As far as I know (and I don't really know that much :)) the split command only lets you specify the number of lines or bytes. The files are all of a different size, so the number of... (4 Replies)
Discussion started by: Migrainegirl
4 Replies

6. Shell Programming and Scripting

need help generating this output

need to check hardware error are zero iostat -en |awk '{ if ( $2 == 0 ) { print " " } else { print " Hardware errors "} } can someone please tell me whats wrong with this ---------- Post updated at 10:19 PM ---------- Previous update was at 10:16 PM ---------- iostat -en ----... (11 Replies)
Discussion started by: arch12
11 Replies

7. Shell Programming and Scripting

renaming the default output name of the split command

Hello, I would like to split a file but I dont what the subfiles to be named the way they are: ex: default name: xaa xab xac xad xae desired name: b01 b02 b03 b04 b05 I know I can rename them afterwards however I have a varialbe split lenghth, in other words I am not sure how... (2 Replies)
Discussion started by: smarones
2 Replies

8. Shell Programming and Scripting

adding file extensions to split output files

Hello, I've searched this forum and others for a solution to my problem but nothing seems just right, I'm hoping I can get some help (seems like this should be easy, and I apologize if I've missed something on the forum): I have several large .fastq DNA sequence files (~20million reads,... (2 Replies)
Discussion started by: ljk
2 Replies

9. Shell Programming and Scripting

Split: File into multiple and keeping the same 3 lines from input into all output files

The following code will split the infile into multiple files. However, I need it to insert the same first 3 lines from the original input file into each splitted file. How do I modify my script below to do so: print -n "Enter file name to split? " ; read infile if then echo "Invalid file... (4 Replies)
Discussion started by: mrn6430
4 Replies

10. Shell Programming and Scripting

Randomly selecting sequences and generating specific output files

I have two files containing hundreds of different sequences with the same Identifiers (ID-001, ID-002, etc.,), something like this: Infile1: ID-001 ATGGGAGCGGGGGCGTCTGCCTTGAGGGGAGAGAAGCTAGATACA ID-002 ATGGGAGCGGGGGCGTCTGTTTTGAGGGGAGAGAAGCTAGATACA ID-003... (18 Replies)
Discussion started by: Xterra
18 Replies
fmt(1)								   User Commands							    fmt(1)

NAME
fmt - simple text formatters SYNOPSIS
fmt [-cs] [-w width | -width] [inputfile]... DESCRIPTION
fmt is a simple text formatter that fills and joins lines to produce output lines of (up to) the number of characters specified in the -w width option. The default width is 72. fmt concatenates the inputfiles listed as arguments. If none are given, fmt formats text from the standard input. Blank lines are preserved in the output, as is the spacing between words. fmt does not fill nor split lines beginning with a `.' (dot), for compatibility with nroff(1). Nor does it fill or split a set of contiguous non-blank lines which is determined to be a mail header, the first line of which must begin with "From". Indentation is preserved in the output, and input lines with differing indentation are not joined (unless -c is used). fmt can also be used as an in-line text filter for vi(1). The vi command: !}fmt reformats the text between the cursor location and the end of the paragraph. OPTIONS
-c Crown margin mode. Preserve the indentation of the first two lines within a paragraph, and align the left margin of each subsequent line with that of the second line. This is useful for tagged paragraphs. -s Split lines only. Do not join short lines to form longer ones. This prevents sample lines of code, and other such for- matted text, from being unduly combined. -w width | -width Fill output lines to up to width columns. OPERANDS
inputfile Input file. ENVIRONMENT VARIABLES
See environ(5) for a description of the LC_CTYPE environment variable that affects the execution of fmt. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
nroff(1), vi(1), attributes(5), environ(5) NOTES
The -width option is acceptable for BSD compatibility, but it may go away in future releases. SunOS 5.11 9 May 1997 fmt(1)
All times are GMT -4. The time now is 10:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy