Sponsored Content
Top Forums Shell Programming and Scripting split a file at a specified string Post 24060 by jpl35 on Thursday 4th of July 2002 10:57:22 AM
Old 07-04-2002
In the last sentence,
awk '/start/,/end/' myfile select from /start/ to /end/, what can i write for :

from /start/ to the end of file ?
Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Split a file with no pattern -- Split, Csplit, Awk

I have gone through all the threads in the forum and tested out different things. I am trying to split a 3GB file into multiple files. Some files are even larger than this. For example: split -l 3000000 filename.txt This is very slow and it splits the file with 3 million records in each... (10 Replies)
Discussion started by: madhunk
10 Replies

2. Shell Programming and Scripting

Split a binary file into 2 basing on 2 delemiter string

Hi all, I have a binary file (orig.dat) and two special delimiter strings 'AAA' and 'BBB'. My binary file's content is as follow: <Data1.1>AAA<Data1.2>BBB <Data2.1>AAA<Data2.2>BBB ... <DataN.1>AAA<DataN.2>BBB DataX.Y might have any length, and contains any kind of special/printable... (1 Reply)
Discussion started by: Averell
1 Replies

3. Shell Programming and Scripting

awk: split a file using a string problems

Hi, if i use this code awk '/String/{n++}{print > f n}' f=file input I get "input" splited this way file1 String 1515 1354 2356 file 2 String 4531 0345 5345 (3 Replies)
Discussion started by: aloctavodia
3 Replies

4. Shell Programming and Scripting

Split string with blancs to pick up information in a file ?

Hello, I am quite new in shell, and would like to pick up information in a file. The file structure is like this faor all data: T 50 2 2.5 is this a candy number color price I know how to pick up a line. I do this: head -linenumber candyfile.doc | tail -1 But I would... (6 Replies)
Discussion started by: shadok
6 Replies

5. Shell Programming and Scripting

Need HELP with AWK split. Need to check for "special characters" in string before splitting the file

Hi Experts. I'm stuck with the below AWK code where i'm trying to move the records containing any special characters in the last field to a bad file. awk -F, '{if ($NF ~ /^|^/) print >"goodfile";else print >"badfile"}' filename sample data 1,abc,def,1234,A * 2,bed,dec,342,* A ... (6 Replies)
Discussion started by: shell_boy23
6 Replies

6. Shell Programming and Scripting

Regex to split a string and write the output in another file.

hi, i am trying to write a script to generate ouput in the following format: ##### buildappi abcd_sh nodebug.##### ##### buildappi ijk_sh nodebug.##### The given string is as follows: xtopSharedDLLs = "abcd_sh def_sh ijk_sh " \ + "jkl_sh any_sh... (15 Replies)
Discussion started by: Rashid Khan
15 Replies

7. Shell Programming and Scripting

Split a fixed length file bases on last occurence of string

Hi, I need to split a file based on last occurece of a string. PFB the explanation I have a file in following format aaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbb ccccccccccccccccccccccccccc ddddddddddddddddddddddddddd 3186rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr... (4 Replies)
Discussion started by: Neelkanth
4 Replies

8. Shell Programming and Scripting

A command to split a file into two based on a string

Hello What command can i use to split a tab delimited txt file into two files base on the occurrence of a string my file name is EDIT.txt The content of file is below XX 1234 PROCEDURES XY 1634 PROCEDURES XM 1245 CODES XZ 1256 CODES It has more than a million record If there is... (16 Replies)
Discussion started by: madrazzii
16 Replies

9. Shell Programming and Scripting

How to Split File based on String?

hi , The scenario is like this, i have a large text files (max 5MB , about 5000 file per day ), Inside almost each line of this file there is a tag 3100.2.22.1 (represent Call_Type) , i need to generate many filess , each one with distinct (3100.2.22.1 Call_Type ) , and one more file to... (3 Replies)
Discussion started by: OTNA
3 Replies

10. Shell Programming and Scripting

How to split a file with delimited string?

I have a unix file text.txt with below content aaaaa bbbbbbb cccccccccc As of 2013 ddddddddd eeeeeeeeee eeeeeeeee fffffffff As of 2014 gggggggggggg hhhhhhhhh iiiiiiiiiiiiiiii As of 2016 Now I've to split this file with each file ending with line 'As of' . Please suggest how can I do... (6 Replies)
Discussion started by: Steven77
6 Replies
TRACE-CMD-SPLIT(1)														TRACE-CMD-SPLIT(1)

NAME
trace-cmd-split - split a trace.dat file into smaller files SYNOPSIS
trace-cmd split [OPTIONS] [start-time [end-time]] DESCRIPTION
The trace-cmd(1) split is used to break up a trace.dat into small files. The start-time specifies where the new file will start at. Using trace-cmd-report(1) and copying the time stamp given at a particular event, can be used as input for either start-time or end-time. The split will stop creating files when it reaches an event after end-time. If only the end-time is needed, use 0.0 as the start-time. If start-time is left out, then the split will start at the beginning of the file. If end-time is left out, then split will continue to the end unless it meets one of the requirements specified by the options. OPTIONS
-i file If this option is not specified, then the split command will look for the file named trace.dat. This options will allow the reading of another file other than trace.dat. -o file By default, the split command will use the input file name as a basis of where to write the split files. The output file will be the input file with an attached '.#' to the end: trace.dat.1, trace.dat.2, etc. This option will change the name of the base file used. -o file will create file.1, file.2, etc. -s seconds This specifies how many seconds should be recorded before the new file should stop. -m milliseconds This specifies how many milliseconds should be recorded before the new file should stop. -u microseconds This specifies how many microseconds should be recorded before the new file should stop. -e events This specifies how many events should be recorded before the new file should stop. -p pages This specifies the number of pages that should be recorded before the new file should stop. Note: only one of *-p*, *-e*, *-u*, *-m*, *-s* may be specified at a time. If *-p* is specified, then *-c* is automatically set. -r This option causes the break up to repeat until end-time is reached (or end of the input if end-time is not specified). trace-cmd split -r -e 10000 This will break up trace.dat into several smaller files, each with at most 10,000 events in it. -c This option causes the above break up to be per CPU. trace-cmd split -c -p 10 This will create a file that has 10 pages per each CPU from the input. SEE ALSO
trace-cmd(1), trace-cmd-record(1), trace-cmd-report(1), trace-cmd-start(1), trace-cmd-stop(1), trace-cmd-extract(1), trace-cmd-reset(1), trace-cmd-list(1), trace-cmd-listen(1) AUTHOR
Written by Steven Rostedt, <rostedt@goodmis.org[1]> RESOURCES
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git COPYING
Copyright (C) 2010 Red Hat, Inc. Free use of this software is granted under the terms of the GNU Public License (GPL). NOTES
1. rostedt@goodmis.org mailto:rostedt@goodmis.org 06/11/2014 TRACE-CMD-SPLIT(1)
All times are GMT -4. The time now is 11:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy