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,
Greetings everyone !!!
I have a file which has many lines, out of which one line is as below.
I need to search for pattern "varchar(30) Select" and if exists, then split the line as below.
I am trying to achieve this in ksh. Can anyone help me on this. (8 Replies)
Discussion started by: Pradhikshan
8 Replies
3. Shell Programming and Scripting
Hi
i have requirement like below
M <form_name> sdasadasdMklkM
D ......
D .....
M form_name> sdasadasdMklkM
D ......
D .....
D ......
D .....
M form_name> sdasadasdMklkM
D ......
M form_name> sdasadasdMklkM
i want split file based on line number by finding... (10 Replies)
Discussion started by: bhaskar v
10 Replies
4. Shell Programming and Scripting
I have a below file.
INPUT FILE
select * from customer
MERGE INTO Archive; delete from Employee; using select * from customer;
delete from employee; select * from Employee;
insert into employee(1,1);
OUTPUT FILE
select * from customer
MERGE INTO Archive
delete from Employee
using... (5 Replies)
Discussion started by: Mohin Jain
5 Replies
5. Shell Programming and Scripting
I have a very large csv file that I sort by the data that is in the second column. But what I need to do next is split the file in groups of say around 30,000 lines but don't split the data while there is still like data in the in the second column.
Here is some of the data.
... (2 Replies)
Discussion started by: GroveTuckey
2 Replies
6. Shell Programming and Scripting
My TSV looks like:
Hello my name is John \t Hello world \t Have a good day! \t See you later!
Is there a simple bash script that splits the tsv on tab to:
Hello my name is John
Hello world
Have a good day!
See you later!
I'm really stuck, would appreciate any help! (5 Replies)
Discussion started by: pxalpine
5 Replies
7. AIX
hi Guys,
Am new to this awesome forum, and yea i need some help here asap thnx :)
i have a directory with over 34000 text files, i need a script that will delete the last line of each of this file without me necessary opening the files.
illustration:-
file1 200 records
file2 130 records... (5 Replies)
Discussion started by: eetang
5 Replies
8. Shell Programming and Scripting
Hello. I'm making a (hopefully) simple shell script xml parser that outputs a file I can grep for information. I am writing it because I have yet to find a command line utility that can do this. If you know of one, please just stop now and tell me about it. Even better would be one I can input... (10 Replies)
Discussion started by: natedawg1013
10 Replies
9. Shell Programming and Scripting
Hello all.
Sorry, I know this question is similar to many others, but I just can seem to put together exactly what I need.
My file is tab delimitted and contains approximately 1 million rows. I would like to send lines 1,4,& 7 to a file. Lines 2, 5, & 8 to a second file. Lines 3, 6, & 9 to... (11 Replies)
Discussion started by: shankster
11 Replies
10. Shell Programming and Scripting
I am writing a script that is running a loop on one file to obtain records from another file.
Using egrep, I am finding matching records in file b, then outputing feilds of both into another file.
****************************
filea=this.txt
fileb=that.txt
cat $filea | while read line
do... (1 Reply)
Discussion started by: djsal
1 Replies