Questions tagged [csplit]

The csplit is a Unix command thats split a file into two or more smaller files determined by context lines.

62 questions
1
vote
1 answer

csplit - what am I doing wrong?

I have this .xml file: Some text here some text here I am trying to use csplit in order to get only the text parts. This is what I came up with. $ csplit docs.xml '%^%1' '/^<\/doc/1'…
imre
  • 379
  • 2
  • 6
  • 17
0
votes
0 answers

Redirect `csplit` output to a pager instead of creating files

I am using scplit to split a large file where the spitting pattern is --. My goal is to redirect all the splits into a pager rather than creating files. In the pager, I want to be able to watch one split at a time. The command to split the file…
Rubem Pacelli
  • 332
  • 2
  • 12
0
votes
0 answers

Csplit invalid pattern

I have to check the access-lists in over 200 devices then compare the new and old access-lists. I used Cisco Mass Configurator to get me the access-lists so I don't have to log in to each devices. I want to split the result (from Cisco Mass…
0
votes
0 answers

Group columns and separate in R

I have a dataset, where I want to group 2 columns together (Proc Right and Days to Proc Right) and separate it from the next group of 2 columns (Proc Left and Days to Proc Left). During separation, I want to separate based on chronology of days to…
0
votes
0 answers

j-argument when using cSplit function in R

I can not find a solution to this error and I am not sure what the cause of it is. I am trying to pull some stats Canada data sets. I have about 500 data points to update each month which can be identified by unique vector numbers. I have a way to…
0
votes
2 answers

csplit regex multiple digits between "[" and "]"

I want to split txt file on string "Template[0]", "Template[1]" etc. The command below works until "Template[10]" csplit -k cert_templates.txt '/Template\[[0-9]\]:/' {*} I tried those but they did'nt work csplit -k cert_templates.txt…
0
votes
1 answer

using csplit and using "incr|full|manual" operator but i like to know which one was match in a line

I have lines bpdppa301p.corpads.local 86929680 JC_UNIX_FS01_INCR JC_FS UNIX_FS01_INCR incr 02/24/2022 03/30/2022 03/30/2022 disk 1645678800 backup 84 MB /dbwsrp01/dbwsrp01 JCBDD1300P.corpads.local bpdppa301p.corpads.local 82578060…
0
votes
0 answers

Need help in my script , for some reason if statement not working

In put file. I am looking for largest size value under each backup type ( db2, rman or file ) for each server. same server may have multiple entry with different value for same backup type. hup00010.corpads.local 84675276 MN_UNIX_NP_7_Days …
0
votes
1 answer

Parsing on the first instance of a set of values

I have a dataframe in R as follows. test <- data.frame("FRUITSTRING" = c("APPLE_PEAR_BANANA", "TURNIP_CABBAGE_ORANGE_PEAR_BANANA", "APPLE_CARROT_PEAR_BANANA"), …
0
votes
0 answers

File with multiple Doctype declaration using CSPLIT

I have a file with multiple Doctype declarations. I am trying to use CSPLIT to break the file up into smaller chunks but running into some issues. Here is a sample of the file I am working with:
0
votes
1 answer

Creating multiple files with names matching a pattern from one file

I have a text file such…
Zez
  • 125
  • 10
0
votes
1 answer

How to transform my data frame to make rows columns?

I have a data frame with two columns, "Type" and "Stats". I want to each type to have one row with all of the stats in a separate column. For example, my data frame looks something like this: Column Type has values: A A A A B B B B Column Stats has…
0
votes
1 answer

Split File based on date prefix?

I have this file.log Sep 16 16:18:49 abcd 123 456 Sep 16 16:18:49 abcd 123 567 Sep 17 16:18:49 abcd 123 456 Sep 17 16:18:49 abcd 123 567 I want to split based on date partition so I get, Sep_16.log Sep 16 16:18:49 abcd 123 456 Sep 16 16:18:49 abcd…
Napitupulu Jon
  • 7,713
  • 3
  • 22
  • 23
0
votes
1 answer

How to csplit on tabs?

I have a tab delimited file with chunks of data separated by lines of empty fields. It looks like this: #comment\n datadatadata\n datadatadata\n \n #comment\n #comment…
Ed Siefker
  • 75
  • 3
0
votes
1 answer

Trouble using csplit to split a text file based on delimiter

I have a text file containing multiple chunks of texts. In between each chunk, I've inserted the string '######## START OF NEW ARTICLE ########'. I'm trying to split the file at each of those instances using csplit in order to get separate files,…
pGNW
  • 1
  • 1