Sponsored Content
Operating Systems Linux Split a large textfile (one file) into multiple file to base on ^L Post 302968570 by RudiC on Friday 11th of March 2016 05:55:13 AM
Old 03-11-2016
Any attempts/ideas/thoughts from your side?

Is that a literal ^L string (two char sequence), or is it a control char <CTRL>L (form feed, 0X0C)?

---------- Post updated at 11:10 ---------- Previous update was at 11:08 ----------

And, is it on a line of its own, or is it dispersed in the text?

---------- Post updated at 11:55 ---------- Previous update was at 11:10 ----------

Howsoever, try
Code:
awk -vRS=$'\f' '{gsub ("^\012", ""); print > "filename" NR ".txt"}' ORS="" file
cf *.txt
filename1.txt:
abc company
abc address
abc contact
filename2.txt:
my company
my address
my contact
my skills
filename3.txt:
your company
your address

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Split A Large File

Hi, I have a large file(csv format) that I need to split into 2 files. The file looks something like Original_file.txt first name, family name, address a, b, c, d, e, f, and so on for over 100,00 lines I need to create two files from this one file. The condition is i need to ensure... (4 Replies)
Discussion started by: nbvcxzdz
4 Replies

2. Shell Programming and Scripting

Split large file and add header and footer to each file

I have one large file, after every 200 line i have to split the file and the add header and footer to each small file? It is possible to add different header and footer to each file? (1 Reply)
Discussion started by: ashish4422
1 Replies

3. Shell Programming and Scripting

Split Large File

HI, i've to split a large file which inputs seems like : Input file name_file.txt 00001|AAAA|MAIL|DATEOFBIRTHT|....... 00001|AAAA|MAIL|DATEOFBIRTHT|....... 00002|BBBB|MAIL|DATEOFBIRTHT|....... 00002|BBBB|MAIL|DATEOFBIRTHT|....... 00003|CCCC|MAIL|DATEOFBIRTHT|.......... (1 Reply)
Discussion started by: AMARA
1 Replies

4. Shell Programming and Scripting

Split a large file

I have a 3 GB text file that I would like to split. How can I do this? It's a giant comma-separated list of numbers. I would like to make it into about 20 files of ~100 MB each, with a custom header and footer. The file can only be split on commas, but they're plentiful. Something like... (3 Replies)
Discussion started by: CRGreathouse
3 Replies

5. Shell Programming and Scripting

Split large file into smaller file

hi Guys i need some help here.. i have a file which has > 800,000 lines in it. I need to split this file into smaller files with 25000 lines each. please help thanks (1 Reply)
Discussion started by: sitaldip
1 Replies

6. Shell Programming and Scripting

Split large zone file dump into multiple files

I have a large zone file dump that consists of ; DNS record for the adomain.com domain data1 data2 data3 data4 data5 CRLF CRLF CRLF ; DNS record for the anotherdomain.com domain data1 data2 data3 data4 data5 data6 CRLF (7 Replies)
Discussion started by: Bluemerlin
7 Replies

7. UNIX for Beginners Questions & Answers

sed awk: split a large file to unique file names

Dear Users, Appreciate your help if you could help me with splitting a large file > 1 million lines with sed or awk. below is the text in the file input file.txt scaffold1 928 929 C/T + scaffold1 942 943 G/C + scaffold1 959 960 C/T +... (6 Replies)
Discussion started by: kapr0001
6 Replies

8. Shell Programming and Scripting

Split Big XML file Base on tag

HI I want to split file base on tag name. I have few header and footer on file <?xml version="1.33" encing="UTF-8"?> <bulkCmConfigDataFile" <xn:SubNetwork id="ONRM_ROOT"> <xn:MeContext id="PPP04156"> ... (4 Replies)
Discussion started by: pareshkp
4 Replies

9. Shell Programming and Scripting

Split a content in a file with specific interval base on the delimited values using UNIX command

Hi All, we have a requirement to split a content in a text file every 5 rows and write in a new file . conditions: if 5th line falls between center of the statement . it should look upto after ";" files are below format: 1 UPDATE TABLE TEST1 SET VALUE ='AFDASDFAS' 2 WHERE... (3 Replies)
Discussion started by: KK230689
3 Replies

10. UNIX for Beginners Questions & Answers

Trying To Split a Large File

Trying to split a 35gb file into 1000mb parts. My research shows I should you this. split -b 1000m file.txt and my return is "split: cannot open 'crunch1.txt' for reading: No such file or directory" so I tried split -b 1000m Documents/Wordlists/file.txt and I get nothing other than the curser just... (3 Replies)
Discussion started by: sub terra
3 Replies
ppmtoxpm(1)						      General Commands Manual						       ppmtoxpm(1)

NAME
ppmtoxpm - convert a portable pixmap into an X11 pixmap SYNOPSIS
ppmtoxpm [-name=xpmname] [-rgb=rgb-textfile] [-alphamask=pgmfile] [ppmfile] Minimum unique abbrevations are acceptable. DESCRIPTION
Reads a portable pixmap as input. Produces X11 pixmap (version 3) as output which can be loaded directly by the XPM library. For example, to convert the file "dot" (found in /usr/include/X11/bitmaps), from xbm to xpm one could specify xbmtopbm dot | ppmtoxpm -name dot or, with a rgb text file (in the local directory) xbmtopbm dot | ppmtoxpm -name dot -rgb rgb.txt OPTIONS
-name=xpmname The -name option allows you to specify the prefix string which is printed in the resulting XPM output. If not specified, will default to the filename (without extension) of the <ppmfile> argument. If you do not specify -name or ppmfile, (i.e. your input is from Standad Input), the prefix string defaults to the string noname. rgb=rgb-textfile The -rgb option allows you to specify an X11 rgb text file for the lookup of color name mnemonics. This rgb text file is typically the /usr/lib/X11/rgb.txt of the MIT X11 distribution, but any file using the same format may be used. When specified and a RGB value from the ppm input matches a RGB value from the <rgb-textfile>, then the corresponding color name mnemonic is printed in the XPM's colormap. If you don't specify -rgb or if the RGB values don't match, then ppmtoxpm produces the color specifications in the #RGB, #RRGGBB, #RRRGGGBBB, or #RRRRGGGGBBBB hexadecimal format. -alphamask=pgmfile This option names a PGM file to use as an alpha (transparency) mask. The file must contain an image the same dimensions as the input image. ppmtoxpm marks as transparent any pixel whose position in the alpha mask image is at most half white. If you don't specify -alphamask, ppmtoxpm makes all pixels in the output opaque. ppmcolormask is one way to generate an alpha mask file. You might also generate it by extracting transparency information from an XPM file with the -alphaout option to xpmtoppm. There are similar options on other Netpbm converters that convert from formats that include transparency information too. LIMITATIONS
An option to match the closest (rather than exact) color name mnemonic from the rgb text would be a desirable enhancement. Truncation of the least significant bits of a RGB value may result in nonexact matches when performing color name mnemonic lookups. SEE ALSO
ppmcolormask(1), xpmtoppm(1), ppm(5) XPM Manual by Arnaud Le Hors lehors@mirsa.inria.fr AUTHOR
Copyright (C) 1990 by Mark W. Snitily. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, pro- vided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in sup- porting documentation. This software is provided "as is" without express or implied warranty. This tool was developed for Schlumberger Technologies, ATE Division, and with their permission is being made available to the public with the above copyright notice and permission notice. Upgraded to XPM2 by Paul Breslaw, Mecasoft SA, Zurich, Switzerland (paul@mecazh.uu.ch) Thu Nov 8 16:01:17 1990 Upgraded to XPM version 3 by Arnaud Le Hors (lehors@mirsa.inria.fr) Tue Apr 9 1991 Tue Apr 9 1991 ppmtoxpm(1)
All times are GMT -4. The time now is 07:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy