Sponsored Content
Top Forums UNIX for Dummies Questions & Answers tab delimited file that is not tab delimited. Post 302592399 by imlearning on Monday 23rd of January 2012 07:06:44 PM
Old 01-23-2012
Quote:
Originally Posted by bartus11
Post output of:
Code:
cat -Te your.file | head

Code:
$ cat -Te  1327.txt | head
country^Iyear^IQty^M$
Japan^I961^I303^M$
Japan^I996^I5021^M$
Japan^I608^I2633^M$
USA^I620^I645^M$
USA^I437^I62^M$
Japan^I565^I90^M$
UK^I705^I730^M$
Japan^I5794^I819^M$
Japan^I890^I5915^M$

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

tab delimited file to commas

Hi there Just wondered if someone could help me out I have a file that has been delimited by tabs, ie field1<tab>fiield2<tab>field3 Does anybody know a command that will convert tabs to commas throughout the entire file? Note: there are a number of unpopulated fields in the file so... (6 Replies)
Discussion started by: hcclnoodles
6 Replies

2. Shell Programming and Scripting

Converting Tab delimited file to Comma delimited file in Unix

Hi, Can anyone let me know on how to convert a Tab delimited file to Comma delimited file in Unix Thanks!! (22 Replies)
Discussion started by: charan81
22 Replies

3. UNIX for Dummies Questions & Answers

Converting Space delimited file to Tab delimited file

Hi all, I have a file with single white space delimited values, I want to convert them to a tab delimited file. I tried sed, tr ... but nothing is working. Thanks, Rajeevan D (16 Replies)
Discussion started by: jeevs81
16 Replies

4. UNIX for Dummies Questions & Answers

100 $1's to new tab delimited file

Hi I have 100 files each with only one column of 10 numbers that I wish to add to a new file so that I get 100 columns collected in one tab delimited file. I tried something like: foreach num (1 2 3) foreach? gawk -F '\t' '{$num=$1}1' OFS='\t' Eu9_10.2patienter/pospep_10.2patient$num >>... (5 Replies)
Discussion started by: Banni
5 Replies

5. Shell Programming and Scripting

Help with converting Pipe delimited file to Tab Delimited

I have a file which was pipe delimited, I need to make it tab delimited. I tried with sed but no use cat file | sed 's/|//t/g' The above command substituted "/t" not tab in the place of pipe. Sample file: abc|123|2012-01-30|2012-04-28|xyz have to convert to: abc 123... (6 Replies)
Discussion started by: karumudi7
6 Replies

6. Shell Programming and Scripting

How to make tab delimited file to space delimited?

Hi How to make tab delimited file to space delimited? in put file: ABC kgy jkh ghj ash kjl o/p file: ABC kgy jkh ghj ash kjl Use code tags, thanks. (1 Reply)
Discussion started by: jagdishrout
1 Replies

7. UNIX for Dummies Questions & Answers

Need help with tab delimited file in unix

Hi, I need urgent help with a tab delimited file I am working on. This is the file : TTTT|YYYYYYY|jargon-journal|MP0000000UID||"j1, j2, j3" I need th following output: TTTT|YYYYYYY|jargon-journal|MP0000000UID||ji TTTT|YYYYYYY|jargon-journal|MP0000000UID||j2... (8 Replies)
Discussion started by: rayarnab
8 Replies

8. UNIX for Dummies Questions & Answers

Need to convert a pipe delimited text file to tab delimited

Hi, I have a rquirement in unix as below . I have a text file with me seperated by | symbol and i need to generate a excel file through unix commands/script so that each value will go to each column. ex: Input Text file: 1|A|apple 2|B|bottle excel file to be generated as output as... (9 Replies)
Discussion started by: raja kakitapall
9 Replies

9. Shell Programming and Scripting

Tab Delimited file in loop

Hi, I have requirement to create tab delimited file with values coming from variables. File will contain only two columns separated by tab. Header will be added once. Values will be keep adding upon the script run. If values already exists then values will be replaced. I have done so... (1 Reply)
Discussion started by: sukhdip
1 Replies

10. UNIX for Beginners Questions & Answers

Replace a column in tab delimited file with column in other tab delimited file,based on match

Hello Everyone.. I want to replace the retail col from FileI with cstp1 col from FileP if the strpno matches in both files FileP.txt ... (2 Replies)
Discussion started by: YogeshG
2 Replies
Locale::Country(3pm)					 Perl Programmers Reference Guide				      Locale::Country(3pm)

NAME
Locale::Country - standard codes for country identification SYNOPSIS
use Locale::Country; $country = code2country('jp' [,CODESET]); # $country gets 'Japan' $code = country2code('Norway' [,CODESET]); # $code gets 'no' @codes = all_country_codes( [CODESET]); @names = all_country_names(); # semi-private routines Locale::Country::alias_code('uk' => 'gb'); Locale::Country::rename_country('gb' => 'Great Britain'); DESCRIPTION
The "Locale::Country" module provides access to several code sets that can be used for identifying countries, such as those defined in ISO 3166-1. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default ISO 3166-1 two-letter codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying countries. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $country = code2country('jp','alpha-2'); $country = code2country('jp',LOCALE_CODE_ALPHA_2); The codesets currently supported are: alpha-2, LOCALE_CODE_ALPHA_2 This is the set of two-letter (lowercase) codes from ISO 3166-1, such as 'tv' for Tuvalu. This is the default code set. alpha-3, LOCALE_CODE_ALPHA_3 This is the set of three-letter (lowercase) codes from ISO 3166-1, such as 'brb' for Barbados. These codes are actually defined and maintained by the U.N. Statistics division. numeric, LOCALE_CODE_NUMERIC This is the set of three-digit numeric codes from ISO 3166-1, such as 064 for Bhutan. These codes are actually defined and maintained by the U.N. Statistics division. If a 2-digit code is entered, it is converted to 3 digits by prepending a 0. fips-10, LOCALE_CODE_FIPS The FIPS 10 data are two-letter (uppercase) codes assigned by the National Geospatial-Intelligence Agency. dom, LOCALE_CODE_DOM The IANA is responsible for delegating management of the top level country domains. The country domains are the two-letter (lowercase) codes from ISO 3166 with a few other additions. ROUTINES
code2country ( CODE [,CODESET] ) country2code ( NAME [,CODESET] ) country_code2code ( CODE ,CODESET ,CODESET2 ) all_country_codes ( [CODESET] ) all_country_names ( [CODESET] ) Locale::Country::rename_country ( CODE ,NEW_NAME [,CODESET] ) Locale::Country::add_country ( CODE ,NAME [,CODESET] ) Locale::Country::delete_country ( CODE [,CODESET] ) Locale::Country::add_country_alias ( NAME ,NEW_NAME ) Locale::Country::delete_country_alias ( NAME ) Locale::Country::rename_country_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Country::add_country_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Country::delete_country_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. alias_code ( ALIAS, CODE [,CODESET] ) Version 2.07 included 2 functions for modifying the internal data: rename_country and alias_code. Both of these could be used only to modify the internal data for country codes. As of 3.10, the internal data for all types of codes can be modified. The alias_code function is preserved for backwards compatibility, but the following two are identical: alias_code(ALIAS,CODE [,CODESET]); rename_country_code(CODE,ALIAS [,CODESET]); and the latter should be used for consistency. The alias_code function is deprecated and will be removed at some point in the future. Note: this function was previously called _alias_code, but the leading underscore has been dropped. The old name was supported for all 2.X releases, but has been dropped as of 3.00. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. Locale::SubCountry ISO codes for country sub-divisions (states, counties, provinces, etc), as defined in ISO 3166-2. This module is not part of the Locale-Codes distribution, but is available from CPAN in CPAN/modules/by-module/Locale/ http://www.iso.org/iso/country_codes Official home page for the ISO 3166 maintenance agency. Unfortunately, they do not make the actual ISO available for free, so I cannot check the alpha-3 and numerical codes here. http://www.iso.org/iso/list-en1-semic-3.txt http://www.iso.org/iso/home/standards/country_codes/iso-3166-1_decoding_table.htm The source of ISO 3166-1 two-letter codes used by this module. http://unstats.un.org/unsd/methods/m49/m49alpha.htm The source of the official ISO 3166-1 three-letter codes and three-digit codes. For some reason, this table is incomplete! Several countries are missing from it, and I cannot find them anywhere on the UN site. I get as much of the data from here as I can. http://earth-info.nga.mil/gns/html/digraphs.htm The official list of the FIPS 10 codes. http://www.iana.org/domains/ Official source of the top-level domain names. https://www.cia.gov/library/publications/the-world-factbook/appendix/print_appendix-d.html The World Factbook maintained by the CIA is a potential source of the data. Unfortunately, it adds/preserves non-standard codes, so it is no longer used as a source of data. http://www.statoids.com/wab.html Another unofficial source of data. Currently, it is not used to get data, but the notes and explanatory material were very useful for understanding discrepancies between the sources. AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 1997-2001 Canon Research Centre Europe (CRE). Copyright (c) 2001-2010 Neil Bowers Copyright (c) 2010-2013 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2014-01-06 Locale::Country(3pm)
All times are GMT -4. The time now is 10:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy