Sponsored Content
Top Forums Shell Programming and Scripting Removing dupes within 2 delimited areas in a large dictionary file Post 302740925 by drl on Friday 7th of December 2012 06:31:15 AM
Old 12-07-2012
Hi.
Quote:
Originally Posted by gimley
... Does PERL give problems with Unicode? ...
You might want to start with: perldoc perlunitu, then man perlunicode

You seem to be using Windows. I have used the utf8 facilities on GNU/Linux systems, but I have no idea whether that might be available in/with ActiveState Perl.

Doing an advanced search here for perl utf8 yields about 50 hits, some of which may be useful.

Best wishes ... cheers, drl

( Edit 1: add note about advanced search )

Last edited by drl; 12-07-2012 at 07:43 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Issue with Removing Carriage Return (^M) in delimited file

Hi - I tried to remove ^M in a delimited file using "tr -d "\r" and "sed 's/^M//g'", but it does not work quite well. While the ^M is removed, the format of the record is still cut in half, like a,b, c c,d,e The delimited file is generated using sh script by outputing a SQL query result to... (7 Replies)
Discussion started by: sirahc
7 Replies

2. Shell Programming and Scripting

Removing blanks in a text tab delimited file

Hi Experts I am very new to perl and need to make a script using perl. I would like to remove blanks in a text tab delimited file in in a specfic column range ( colum 21 to column 43) sample input and output shown below : Input: 117 102 650 652 654 656 117 93 95... (3 Replies)
Discussion started by: Faisal Riaz
3 Replies

3. Shell Programming and Scripting

Removing Embedded Newline from Delimited File

Hey there - a bit of background on what I'm trying to accomplish, first off. I am trying to load the data from a pipe delimited file into a database. The loading tool that I use cannot handle embedded newline characters within a field, so I need to scrub them out. Solutions that I have tried... (7 Replies)
Discussion started by: bbetteridge
7 Replies

4. Shell Programming and Scripting

Large pipe delimited file that I need to add CR/LF every n fields

I have a large flat file with variable length fields that are pipe delimited. The file has no new line or CR/LF characters to indicate a new record. I need to parse the file and after some number of fields, I need to insert a CR/LF to start the next record. Input file ... (2 Replies)
Discussion started by: clintrpeterson
2 Replies

5. Shell Programming and Scripting

Extracting a portion of data from a very large tab delimited text file

Hi All I wanted to know how to effectively delete some columns in a large tab delimited file. I have a file that contains 5 columns and almost 100,000 rows 3456 f g t t 3456 g h 456 f h 4567 f g h z 345 f g 567 h j k lThis is a very large data file and tab delimited. I need... (2 Replies)
Discussion started by: Lucky Ali
2 Replies

6. Shell Programming and Scripting

Script Optimization - large delimited file, for loop with many greps

Since there are approximately 75K gsfiles and hundreds of stfiles per gsfile, this script can take hours. How can I rewrite this script, so that it's much faster? I'm not as familiar with perl but I'm open to all suggestions. ls file.list>$split for gsfile in `cat $split`; do csplit... (17 Replies)
Discussion started by: verge
17 Replies

7. Shell Programming and Scripting

Removing Dupes from huge file- awk/perl/uniq

Hi, I have the following command in place nawk -F, '!a++' file > file.uniq It has been working perfectly as per requirements, by removing duplicates by taking into consideration only first 3 fields. Recently it has started giving below error: bash-3.2$ nawk -F, '!a++'... (17 Replies)
Discussion started by: makn
17 Replies

8. Shell Programming and Scripting

Merging dupes on different lines in a dictionary

I am working on a homonym dictionary of names i.e. names which are clustered together according to their “sound-alike” pronunciation: An example will make this clear: Since the dictionary is manually constructed it often happens that inadvertently two sets of “homonyms” which should be grouped... (2 Replies)
Discussion started by: gimley
2 Replies

9. UNIX for Advanced & Expert Users

Need optimized awk/perl/shell to give the statistics for the Large delimited file

I have a file size is around 24 G with 14 columns, delimiter with "|" My requirement- can anyone provide me the fastest and best to get the below results Number of records of the file First column and second Column- Unique counts Thanks for your time Karti ------ Post updated at... (3 Replies)
Discussion started by: kartikirans
3 Replies

10. Shell Programming and Scripting

Remove dupes in a large file

I have a large file 1.5 gb and want to sort the file. I used the following AWK script to do the job !x++ The script works but it is very slow and takes over an hour to do the job. I suspect this is because the file is not sorted. Any solution to speed up the AWk script or a Perl script would... (4 Replies)
Discussion started by: gimley
4 Replies
PERLKO(1)						 Perl Programmers Reference Guide						 PERLKO(1)

NAME
perlko - PerlX XXX XXX DESCRIPTION
PerlX XXX XX XX XXXXX ! PerlX 5.8.0XXX XXXX/ISO 10646X XX XXXX XXX XXX. XXXX XXX XXXX XXXX XXX XX XXXX XXXX XXX XX XXX XXX XX XXX XX XXX XXXX XXXXX. XXXXX X XXXX XXX XX XXX XX XX XX - XXX XX XXX, XX XXX, XXX XXX, XXX XX XXXX XXX XX XXXX, XX XX, XXX XX, XXXX XX, XXXX XX, XXXX XX, XX XXXX XX XX X-X XXXX XX XXX XX XX XXX XXX XXX X XX X XX XXX XX XXX XXX XX XXX XXXX X X XX XX XXX XXXX XX XX XXXX XXXX XX XX XX XX XXX XXXX XXXX. PerlX XXXXX XXXXX XX XXX XX XXXXX. XX XXXXX XXX Perl XXXX XXX UTF-8 XXXX X X XX, XX XXX XXX(XX XX, XXX, index, substr)X XXX XX XX XXXX XX XXX XXXXX. (X XXX XX perlunicode XXXX XXXXXX.) XXXXX XX XXXX XX XX XXX XXX, XXX XX XXX XX XX/X XXX XXXXX XXXX XX XX XXXXX X XXXX XXX XXX XX XX XX 'Encode'X XXXXX. XXXX 'Encode'X XX XXX XXX XXX XXX XX X X XXXX. 'Encode'X XXX XX XXX XXXX XXXXX. euc-kr US-ASCIIX KS X 1001X XX XX XXXXX XXX (XX XXXXXX XX.) KS X 2901X RFC 1557 XX. cp949 MS-Windows 9x/MEXX XXX XX XXX. euc-krX 8,822XX XX XXX XX XX. aliasX uhc, windows-949, x-windows-949, ks_c_5601-1987. X XXX XXX XXXX XX XXXXX, Microsoft XXXX CP949X XXX XXX XX. johab KS X 1001:1998 XX 3XX XXX XXX. XX XXXXX cp949X XXXXX US-ASCIIX KS X 1001X 8,822XX XX XXX XX XX. XXX XXX XX XX. iso-2022-kr RFC 1557XX XXX XXX XXX XX XXX XXXXX US-ASCIIX KS X 1001X XXXXX XX XXX euc-krX XXX XXX XXX XX. 1997-8X XXX XXXX X XX XX XXX XXX XX. ksc5601-raw KS X 1001(KS C 5601)X GL(X, MSBX 0XX X XX) X XXX XX XXX. US-ASCIIX XXXX XX XXXX XXX XX X11 XXX XX XXX (ksc5601.1987-0. '0'X GLX XXX.)XX XXX XX XXXXX XX XX. KS C 5601X 1997X KS X 1001X XXX XXXX. 1998XXX X XX (XXX XXX XX XX XX)X XXXX. X XX XX XXX XXX XXXX. XX XX, euc-kr XXXXX X XXX UTF-8X XXXXX XXX XX XX XXX. perl -Mencoding=euc-kr,STDOUT,utf8 -pe1 < file.euckr > file.utf8 XXXX XXX XX X X XXXX. perl -Mencoding=utf8,STDOUT,euc-kr -pe1 < file.utf8 > file.euckr XX XXX XX XXXX X X XXX Encode XXX XX XXXX PerlXX XX piconvX PerlX XX XXXX. X XXXX X X XXX piconvX UnixX XX iconvX XXX X XXXX. X XXXX XXX XXXX. piconv -f euc-kr -t utf8 < file.euckr > file.utf8 piconv -f utf8 -t euc-kr < file.utf8 > file.euckr X, 'PerlIO::encoding' XXX XX XXX XXXX XXX XX XX (XXX XXX XXX) XXX XX X X XXXX. #!/path/to/perl use encoding 'euc-kr', STDIN => 'euc-kr', STDOUT-> 'euc-kr', STDERR=>'euc-kr'; print length("XX"); # 2 (X XXXX XX XX XXX XX) print length('XX'); # 4 (XX XXXX XXX XX XXX XX) print index("XX, XXX", "X"); # -1 ('X'X XX) print index('XX, XXX', 'X'); # 7 (8XXX 9XX XXXX 'X'X XXXX XXX.) X XXX XX XXX... PerlX XXXX XXX XXX XXX XX XX XX, X XXX XX Perl XX X XXX XXXX XX, EncodeX XXX XX XX XX XX X XXXX. XX X XXX XX XX XXX XX XXXX. Perl XX XX XXX XXX XX XXX XXX XX XXX XXXX. X XXX XX XXX XX XXX XX XXXX XX XX XXXX. <http://www.perl.com/> O'ReillyX Perl X XXX <http://www.cpan.org/> Comprehensive Perl Archive Network <http://lists.perl.org/> Perl XXX XXX. XX XXX XXX perl-unicodeXX 'Encode'X XX XXX. PerlX X XX XXXXX XXX X X XX XXX XX XXX <http://www.perl.or.kr/> Perl XX XXX XX <news:han.comp.lang.perl/> XXX Perl XX XX <http://www.hanb.co.kr/search/searchResult.html?keyword=perl> O'ReillyXX XX XXX Perl XX XX <http://www.perlschool.net/> Perl XX XX X XX, XX XX, XX XX XXX XX <http://www.perl.co.kr> PerlX XXX CGI, DB, XX XX XX XX X XX XX XXXX X XXX XXX XX XX <http://www.unicode.org/> XXXX XXXX. <http://std.dkuug.dk/JTC1/SC2/WG2> XXXXX UnicodeX XX ISO XXX ISO/IEC 10646 UCS(Universal Character Set)X XXX ISO/IEC JTC1/SC2/WG2X X XXX. <http://www.cl.cam.ac.uk/~mgk25/unicode.html> XXX/XXXXX XXXXX UTF-8 XXX XX XXX(FAQ) http://wiki.kldp.org/Translations/html/UTF8-Unicode-KLDP/UTF8-Unicode-KLDP.html <http://wiki.kldp.org/Translations/html/UTF8-Unicode- KLDP/UTF8-Unicode-KLDP.html> XXX/XXXXX XXXXX UTF-8 XXX XX XXX(FAQ)X XXX XX SEE ALSO
Encode, Encode::KR, encoding, perluniintro, perlunicode AUTHORS
Jarkko Hietaniemi <jhi@iki.fi> XXX <jshin@mailaps.org> perl v5.16.2 2012-10-11 PERLKO(1)
All times are GMT -4. The time now is 06:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy