01-29-2017
Hi, My data has unix new line terminators in the data lelvel. I should not convert the line terminator. I have to split the file into equal parts with out line terminator conversion
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
Hi experts.
I got a file (500mb max) and need to pivot it (loading into ORCL) and change BLANK delimiter to PIPE |.
Sometimes there are multipel BLANKS (as a particular value may be BLANK, or simply two BLANKS instead of one BLANK).
thanks for your input!
Cheers,
Layout... (3 Replies)
Discussion started by: thomasr
3 Replies
3. Shell Programming and Scripting
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
Hi,
My inputfile contains field separaer is ^.
12^inms^
13^fakdks^ssk^s3
23^avsd^
13^fakdks^ssk^a4
I wanted to print only 2 delimiter occurence i.e
12^inms^
23^avsd^ (4 Replies)
Discussion started by: Jairaj
4 Replies
5. Shell Programming and Scripting
Hi All,
I'm a newbie here, I'm just wondering on how to delete a single record in a large file in unix.
ex.
file1.txt is 1000 records
nikki1
nikki2
nikki3
what i want to do is delete the nikki2 record in file1.txt. is it possible?
Please advise,
Thanks, (3 Replies)
Discussion started by: nikki1200
3 Replies
6. Shell Programming and Scripting
Hello,
I want to split a big file into smaller ones with certain "counts". I am aware this type of job has been asked quite often, but I posted again when I came to csplit, which may be simpler to solve the problem.
Input file (fasta format):
>seq1
agtcagtc
agtcagtc
ag
>seq2
agtcagtcagtc... (8 Replies)
Discussion started by: yifangt
8 Replies
7. Shell Programming and Scripting
Hi,
I have a file which has many URLs delimited by space. Now i want them to move to separate files each one holding 10 URLs per file.
http://3276.e-printphoto.co.uk/guardian http://abdera.apache.org/ http://abdera.apache.org/docs/api/index.html
I have used the below code to arrange... (6 Replies)
Discussion started by: vel4ever
6 Replies
8. Shell Programming and Scripting
Hello All,
I have a large file, more than 50,000 lines, and I want to split it in even 5000 records. Which I can do using
sed '1d;$d;' <filename> | awk 'NR%5000==1{x="F"++i;}{print > x}'Now I need to add one more condition that is not to break the file at 5000th record if the 5000th record... (20 Replies)
Discussion started by: ibmtech
20 Replies
9. Shell Programming and Scripting
Hi, all.
I have an input file. I would like to generate 3 types of output files.
Input:
LG10_PM_map_19_LEnd_1000560
LG10_PM_map_6-1_27101856
LG10_PM_map_71_REnd_20597718
LG12_PM_map_5_chr_118419232
LG13_PM_map_121_24341052
LG14_PM_1a_456799
LG1_MM_scf_5a_opt_abc_9029993
... (5 Replies)
Discussion started by: huiyee1
5 Replies
10. Shell Programming and Scripting
My requirment is for every record of a particular file I've to check for a record delimeter (e.g. "\n") and if any row doesn't have "\n" then report it in error file .
Please suggest me to go through this. (4 Replies)
Discussion started by: manab86
4 Replies
LEARN ABOUT CENTOS
ppi::token::heredoc
PPI::Token::HereDoc(3) User Contributed Perl Documentation PPI::Token::HereDoc(3)
NAME
PPI::Token::HereDoc - Token class for the here-doc
INHERITANCE
PPI::Token::HereDoc
isa PPI::Token
isa PPI::Element
DESCRIPTION
Here-docs are incredibly handy when writing Perl, but incredibly tricky when parsing it, primarily because they don't follow the general
flow of input.
They jump ahead and nab lines directly off the input buffer. Whitespace and newlines may not matter in most Perl code, but they matter in
here-docs.
They are also tricky to store as an object. They look sort of like an operator and a string, but they don't act like it. And they have a
second section that should be something like a separate token, but isn't because a strong can span from above the here-doc content to below
it.
So when parsing, this is what we do.
Firstly, the PPI::Token::HereDoc object, does not represent the "<<" operator, or the "END_FLAG", or the content, or even the terminator.
It represents all of them at once.
The token itself has only the declaration part as its "content".
# This is what the content of a HereDoc token is
<<FOO
# Or this
<<"FOO"
# Or even this
<< 'FOO'
That is, the "operator", any whitespace separator, and the quoted or bare terminator. So when you call the "content" method on a HereDoc
token, you get '<< "FOO"'.
As for the content and the terminator, when treated purely in "content" terms they do not exist.
The content is made available with the "heredoc" method, and the name of the terminator with the "terminator" method.
To make things work in the way you expect, PPI has to play some games when doing line/column location calculation for tokens, and also
during the content parsing and generation processes.
Documents cannot simply by recreated by stitching together the token contents, and involve a somewhat more expensive procedure, but the
extra expense should be relatively negligible unless you are doing huge quantities of them.
Please note that due to the immature nature of PPI in general, we expect "HereDocs" to be a rich (bad) source of corner-case bugs for quite
a while, but for the most part they should more or less DWYM.
Comparison to other string types
Although technically it can be considered a quote, for the time being "HereDocs" are being treated as a completely separate "Token"
subclass, and will not be found in a search for PPI::Token::Quote or "PPI::Token::QuoteLike objects".
This may change in the future, with it most likely to end up under QuoteLike.
METHODS
Although it has the standard set of "Token" methods, "HereDoc" objects have a relatively large number of unique methods all of their own.
heredoc
The "heredoc" method is the authoritative method for accessing the contents of the "HereDoc" object.
It returns the contents of the here-doc as a list of newline-terminated strings. If called in scalar context, it returns the number of
lines in the here-doc, excluding the terminator line.
terminator
The "terminator" method returns the name of the terminating string for the here-doc.
Returns the terminating string as an unescaped string (in the rare case the terminator has an escaped quote in it).
TO DO
- Implement PPI::Token::Quote interface compatibility
- Check CPAN for any use of the null here-doc or here-doc-in-s///e
- Add support for the null here-doc
- Add support for here-doc in s///e
SUPPORT
See the support section in the main module.
AUTHOR
Adam Kennedy <adamk@cpan.org>
COPYRIGHT
Copyright 2001 - 2011 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.16.3 2011-02-26 PPI::Token::HereDoc(3)