10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I am using below code to split files based on blank lines but it does not work.
awk 'BEGIN{i=0}{RS="";}{x="F"++i;}{print > x;}'
Your help would be highly appreciated
find attachment of sample.txt file (2 Replies)
Discussion started by: imranrasheedamu
2 Replies
2. UNIX for Dummies Questions & Answers
Hello All ,
I have a file which needs to split based on the blank lines
Name ABC
Address London
Age 32
(4 blank new line)
Name DEF
Address London
Age 30
(4 blank new line)
Name DEF
Address London (8 Replies)
Discussion started by: Pratik4891
8 Replies
3. Shell Programming and Scripting
Hi guys,
I have a requirement where i need to split a .csv file into multiple files.
Say for example i have data.csv file and i have splitted that into multiple files based on some conditions i.e first file should have 100, last file 50 and other files 1000 each. Am passing the values in... (2 Replies)
Discussion started by: azherkn3
2 Replies
4. UNIX for Dummies Questions & Answers
Hello Friends,
Can anyone help me for the below requirement.
I am having a file called Input.txt.
My requirement is first check the count that is wc -l input.txt
If the result of the wc -l Input.txt is less than 10 then don't split the Input.txt file. Where as if Input.txt >= 10 the split... (12 Replies)
Discussion started by: malaya kumar
12 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am new to unix. we have a requirement here to split a single file into multiples files based on the number of people available for processing. So i tried my hand at writing some code as below.
#!/bin/bash
var1=`wc -l $filename`
var2=$var1/$splitno
split -l $var2 $1
Please help me... (6 Replies)
Discussion started by: quirkguy
6 Replies
6. Shell Programming and Scripting
Let's assume that I have a file name called ‘A' and it has 100 lines in it and would like to split these 100 lines into 4 files as specified bellow.
INPUT: Input file name A
1
2
3
4
5
6
7
8
9
........100
Output: 4 output files (x,y,z,w)
File x should contains (Skip 4 lines)... (15 Replies)
Discussion started by: subbarao25
15 Replies
7. Shell Programming and Scripting
I am getting a few gzip files into a folder by doing ftp to another server. Once I get them I move them to another location .But before that I need to make sure each gzip is not more than 5000 lines and split it up . The files I get are anywhere from 500 lines to 10000 lines in them and is in gzip... (4 Replies)
Discussion started by: gubbu
4 Replies
8. Shell Programming and Scripting
Dear All,
I would like to split a file of the following format into multiple files based on the number in the 6th column (numbers 1, 2, 3...):
ATOM 1 N GLY A 1 -3.198 27.537 -5.958 1.00 0.00 N
ATOM 2 CA GLY A 1 -2.199 28.399 -6.617 1.00 0.00 ... (3 Replies)
Discussion started by: tomasl
3 Replies
9. Shell Programming and Scripting
Experts,
I have a file datafile.txt that consists of 1732 Line,
I want to split the file into equal number of lines with 10 file.
(The last file can have 2 line extra to match 1732)
Please advise how to do that,
Thanks in advance.. (2 Replies)
Discussion started by: rveri
2 Replies
10. UNIX for Dummies Questions & Answers
I have been googling on the 'split' unix command to see if it can split a large file into 'n' number of files. Can anyone spare an example or a code snippet?
Thanks,
- CB (2 Replies)
Discussion started by: ChicagoBlues
2 Replies