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 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
5. 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
6. Shell Programming and Scripting
Hello,
Working on a ksh script and a little stumped... how can I return all characters to the left of the last delimeter per line in a file, skipping any lines without that delimeter?
ie, sample.txt:
Once_upon-a-Midnight_dreary_while
I pondered, weak_and weary
over many a quaint
and... (4 Replies)
Discussion started by: MoreCowbell
4 Replies
7. Web Development
I have a SQL query
SELECT
BLAH_ID,
BLAH_CODE,
DATEFORMAT(CALENDAR_DATE, 'MM-DD-YYYY') AS CALENDAR_DATE_STR,
HOURS,
'N',
FROM blah_tmp_tbl order by CALENDAR_DATE_STR,BLAH_ID,BLAH_CODE;
OUTPUT TO 'MyExport.CSV' quote '' FORMAT ASCII;
That gets me the below output;
... (2 Replies)
Discussion started by: ffdstanley
2 Replies
8. Shell Programming and Scripting
Hi guys, plz tell me how to achieve this
how to delete the lines in a file using sed command (6 Replies)
Discussion started by: hari908
6 Replies
9. Shell Programming and Scripting
I have a file containing about 5 million rows, in the file there are some records which has extra delimiter at random position. (we dont know the positions), now we have to Count the delimeter from each row and if the count of delimeter is not matching then I want to delete those rows from the... (5 Replies)
Discussion started by: Akumar1
5 Replies
10. 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