in reply to Re: Semicolon delimited to Comma delimited
in thread Semicolon delimited to Comma delimited
Thanks! I already did think of that solution but i must also mention it was my last choice! You can see why in my reply to 'marinersk'. But someone gave me a nice idea which could work(i have not tested this yet but could definitely be a light in the dark tunnel of CSV/Excel features!)
#Get system language id to know German/US format of excels Win32::API->Import('kernel32.dll', 'long GetSystemDefaultLangID()') or + die "Can't import GetSystemDefaultLangID: $^E\n"; $langid = GetSystemDefaultLangID() & 0xFFFF or die "ERROR: LANGID Retu +rned <undef>\n"; # Mask out the garbage in high-order bytes #my $langid = GetSystemDefaultLangID(); warn "my language id is :" .$langid;
This could be used at the start of a Perl script to identify if the list separator that comes along with a *.csv is going to be a semi-colon or comma! I do hope this comes in handy to anyone who faces this problem in the future!
Thank you fellow monks for your delightful replies!! I shall post one final comment if this idea works out. If not (i do hope it would), guess the discussion is still open for ideas!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Semicolon delimited to Comma delimited
by afoken (Chancellor) on Apr 24, 2015 at 16:09 UTC | |
Re^3: Semicolon delimited to Comma delimited
by afoken (Chancellor) on Apr 24, 2015 at 17:56 UTC |