05-09-2011
Ok I figured out it is because the file contains commas inside quoted fields. And looking out there seems like a pain to use awk then. What about Perl, anyone know how to use it to solve the problem? Thanks!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have file1.txt and file2.txt and would like to create file3.txt based on one column in UNIX
Eg:
file1.txt
17328756,0000786623.pdf,0000786623
20115537,0000793892.pdf,0000793892
file2.txt
12521_74_4.zip,0000786623.pdf
12521_15_5.zip,0000793892.pdf
Desired Output
... (5 Replies)
Discussion started by: techmoris
5 Replies
2. Shell Programming and Scripting
Hi,
I have different files of the same type, as:
Time:
100
snr:
88
perf:
10
other:
222
Each of these files are created periodically.
What I need to do is to merge all of them into one but having the following form: (2 Replies)
Discussion started by: Ravendark
2 Replies
3. Shell Programming and Scripting
Hi all,
I have a list of xml file. I need to split the files to a different files when see the <ko> tag.
The list of filename are
B20090908.1100-20090908.1200_CDMA=1,NO=2,SITE=3.xml
B20090908.1200-20090908.1300_CDMA=1,NO=2,SITE=3.xml
B20090908.1300-20090908.1400_CDMA=1,NO=2,SITE=3.xml
... (3 Replies)
Discussion started by: natalie23
3 Replies
4. Shell Programming and Scripting
SHELL SCRIPT
Hi,
I have 3 separate files within a folder. Every File contains data in a single column like
File1 contains data
mayank
sushant
dheeraj
File2 contains
DSA_AT
MG_AT
FLAT_09
File3 contains data
123123
232323 (2 Replies)
Discussion started by: mayanksargoch
2 Replies
5. Shell Programming and Scripting
Hi,
I created a list with 2 columns.
Each line is from a different file. I am getting these with a loop in Perl. I would like to add a 3rd column with the name of the file that the line is coming from.
I usually use pr to print the filename but this is not working here ... I was wondering if... (5 Replies)
Discussion started by: danieladna
5 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I need to create a .csv file from information that i have in two different tab delimited .txt file. I just want to select some of the columns of each .txt file and paste them into a .cvs file.
My files look like:
File 1
transcript_id Seq. Description Seq. Length ... (2 Replies)
Discussion started by: alisrpp
2 Replies
7. Shell Programming and Scripting
Hello
Below is my requirement
I have 3 files A1.txt , A2.txt and A3.txt . A2 is dynamically generating file
I want the merge of A1,A2 and A3 in A2.txt
Could you please help? (3 Replies)
Discussion started by: Pratik4891
3 Replies
8. Shell Programming and Scripting
Hi, I am newbie in shell script.
I need your help to solve my problem.
Firstly, I have 2 files of csv and i want to compare of the contents then the output will be written in a new csv file.
File1:
SourceFile,DateTimeOriginal
/home/intannf/foto/IMG_0713.JPG,2015:02:17 11:14:07... (8 Replies)
Discussion started by: refrain
8 Replies
9. UNIX for Dummies Questions & Answers
Hi all,
I have two separate csv files(comma delimited) file 1 and file 2.
File 1 contains
PAN,NAME,Salary
AAAAA5467D,Raj,50000
AAFAC5467D,Ram,60000
BDCFA5677D,Kumar,90000
File 2 contains
PAN,NAME,Dept,Salary
ASDFG6756T,Karthik,ABC,450000
QWERT8765Y,JAX,CDR,780000... (5 Replies)
Discussion started by: Nivas
5 Replies
10. Shell Programming and Scripting
I am trying to merge all csv files from source path into one single csv file in target. but getting error message:
hadoop fs -cat /user/hive/warehouse/stage.db/PK_CLOUD_CHARGE/TCH-charge_*.csv > /user/hive/warehouse/stage.db/PK_CLOUD_CHARGE/final/TCH_pb_charge.csv
getting error message:... (0 Replies)
Discussion started by: cplusplus1
0 Replies
LEARN ABOUT DEBIAN
yaml::xs
YAML::XS(3pm) User Contributed Perl Documentation YAML::XS(3pm)
NAME
YAML::XS - Perl YAML Serialization using XS and libyaml
SYNOPSIS
use YAML::XS;
my $yaml = Dump [ 1..4 ];
my $array = Load $yaml;
DESCRIPTION
Kirill Siminov's "libyaml" is arguably the best YAML implementation. The C library is written precisely to the YAML 1.1 specification. It
was originally bound to Python and was later bound to Ruby.
This module is a Perl XS binding to libyaml which offers Perl the best YAML support to date.
This module exports the functions "Dump", "Load", "DumpFile" and "LoadFile". These functions are intended to work exactly like "YAML.pm"'s
corresponding functions.
CONFIGURATION
$YAML::XS::UseCode
$YAML::XS::DumpCode
$YAML::XS::LoadCode
If enabled supports deparsing and evaling of code blocks.
$YAML::XS::QuoteNumericStrings
When true (the default) strings that look like numbers but have not been numified will be quoted when dumping.
This ensures leading that things like leading zeros and other formatting are preserved.
USING YAML
::XS WITH UNICODE
Handling unicode properly in Perl can be a pain. YAML::XS only deals with streams of utf8 octets. Just remember this:
$perl = Load($utf8_octets);
$utf8_octets = Dump($perl);
There are many, many places where things can go wrong with unicode. If you are having problems, use Devel::Peek on all the possible data
points.
SEE ALSO
* YAML.pm
* YAML::Syck
* YAML::Tiny
AUTHOR
Ingy doet Net <ingy@cpan.org>
COPYRIGHT
Copyright (c) 2007, 2008, 2010, 2011. Ingy doet Net.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
perl v5.14.2 2012-01-04 YAML::XS(3pm)