10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have to split a file containing 100 lines to 5 files say from lines ,1-20 ,21-30 ,31-40 ,51-60 ,61-100
Here is i can do it for 2 file but how to handle it for more than 2 files
awk 'NR < 21{ print >> "a"; next } {print >> "b" }' $input_file
Please advidse.
Thanks (4 Replies)
Discussion started by: abhaydas
4 Replies
2. Shell Programming and Scripting
Hi All,
I have more than half million lines of XML file , wanted to split in four files in a such a way that top 7 lines should be present in each file on top and bottom line of should be present in each file at bottom.
from the 8th line actual record starts and each record contains 15 lines... (14 Replies)
Discussion started by: ajju
14 Replies
3. Shell Programming and Scripting
Hi I have a file with over a million lines (rows) and I want to split everything from 500,000 to a million into another file (to make the file smaller). Is there a simple command for this?
Thank you
Phil (4 Replies)
Discussion started by: phil_heath
4 Replies
4. Shell Programming and Scripting
Hello friends,
Is there any way to split file from n to n+6 into 1 file and (n+7) to (n+16) into other file etc.
f.e I have source pipe delimated file with 20 lines and i need to split 1-6 in file1 and 7-16 in file2 and 17-20 in file 3
I need to split into fixed number of file like 4 files... (2 Replies)
Discussion started by: Rizzu155
2 Replies
5. Shell Programming and Scripting
Hi,
I have a huge file with a single line.
But I want to break that line into lines of with each line having five columns.
My file is like this:
code:
"hi","there","how","are","you?","It","was","great","working","with","you.","hope","to","work","you."
I want it like this:
code:... (1 Reply)
Discussion started by: rajsharma
1 Replies
6. Shell Programming and Scripting
I have a 12M line file that I need to split into smaller files but I'm getting a
csplit: virtual memory exhausted error
How can I quickly split this file?
This is sze
-r-xr-xr-x+ 1 VERGE Domain Users 1158288000 May 4 16:31 inputfile
This is the command I've tried...
csplit... (4 Replies)
Discussion started by: verge
4 Replies
7. Shell Programming and Scripting
A file file1.txt exists having records like
The delimiter being "|"
X|_|Y|_|Z|_| (number of fields 7)
A|_|B|_| (number of fields 5)
X|_|Z|_|H|_| (number of fields 7)
A|_|D|_|S|_| (number of... (4 Replies)
Discussion started by: centurion_13
4 Replies
8. UNIX for Dummies Questions & Answers
Hello Everyone.
I am trying to display contains of a file from a specific line to a specific line(let say, from line number 3 to line number 5). For this I got the shell script as shown below:
if ; then
if ; then
tail +$1 $3 | head -n $2
else
... (5 Replies)
Discussion started by: grc
5 Replies
9. Shell Programming and Scripting
Hi Everybody,
I am trying to write a script that will get some perticuler data from a file and redirect to a file.
My Question is,
I have a Very huge file,In that file I have my required data is started from 25th line and it will ends in 100th line.
I know the line numbers, I need to get all... (9 Replies)
Discussion started by: Anji
9 Replies
10. Shell Programming and Scripting
Hi,
I'm, new to shell scripting, I have a requirement where I have to split an incoming file into separate files each containing a maximum of 3 million rows.
For e.g: if my incoming file say In.txt has 8 mn rows then I need to create 3 files, in which two will 3 mn rows and one will contain 2... (2 Replies)
Discussion started by: wahi80
2 Replies