Sponsored Content
Top Forums Shell Programming and Scripting sed multilines + separator confusion !! Post 302923458 by RudiC on Monday 3rd of November 2014 05:10:08 AM
Old 11-03-2014
There have been presented umpteen solutions to similar problems in these fora. In this case, and for exactly your sample (which BTW has 89 fields per line), try
Code:
sed ':A;/,$/!N; s/\n//;tA'  /tmp/sed_example.txt

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sed confusion

Hello all, I am trying to delete all the lines in a particular file having a pattern. The problem is that it has special characters and for some reason is not doing the job. For eg. src_file /home/test/filelist.txt :xxxx:ogog /home/test/RCH/ogogogg /home/test/RYHUJ/HHHH... (3 Replies)
Discussion started by: alfredo123
3 Replies

2. UNIX for Dummies Questions & Answers

'tr' confusion

Good day, everyone! Could anybody explain me the following situation. If I'm running similar script: Var="anna.kurnikova" Var2="Anna Kurn" echo $Var | tr -t "$Var" "$Var2" Why the output is : anna KurniKova instead of Anna Kurnikova? :confused: Thank you in advance for any... (2 Replies)
Discussion started by: Nafanja
2 Replies

3. Shell Programming and Scripting

Trying to change date separator with sed

Hi there I am trying to convert some date seperators in a large newline delimited file. each line i am interested in has a date in the format 27/05/2009 all I want is to convert the slashes to tildes(~) I have come up with the following code but it does nothing. sed... (5 Replies)
Discussion started by: RadRod
5 Replies

4. UNIX for Dummies Questions & Answers

Sed - Get Separator From String

Hi All, I have the following data in a korn shell variable: a="FirstValue|SecondValue|ThirdValue" The value between "FirstValue", "SecondValue" and "ThirdValue" can change, in this case is a comma: "," and I need to print it only once. I need to know what is the separator value. I... (3 Replies)
Discussion started by: felipe.vinturin
3 Replies

5. Shell Programming and Scripting

Shell Script to convert multilines to single lines

Hi, I need to create an script which reads multi lines and convert it to single line or enter escape sequence at end "\". e.g. #!/bin/sh echo -e "provide me query to run" read query create table test( id int(11), name char); echo $query But it's failing because of multi line... (8 Replies)
Discussion started by: mirfan
8 Replies

6. Shell Programming and Scripting

sed to insert a separator

My txt file consists of records with 6 numbers followed by 3 characters. Is there a simple “sed” which will insert a | separator between the 6th and 7th position ? Many thanks (3 Replies)
Discussion started by: malts18
3 Replies

7. Shell Programming and Scripting

Confusion with PS

Hello All, I have a problem in counting number of process getting run with my current script name.. Here it is ps -ef | grep $0 | grep -v grep This display just one line with the PID, PPID and other details when i print it in the script. But when I want to count the numbers in my... (11 Replies)
Discussion started by: sathyaonnuix
11 Replies

8. Shell Programming and Scripting

Convert Singleline to Multilines

Hi All, Could you please help to get the below output: Input: J1,ELLA_1,ISDR,JJK,TRS J2,ROSTER,JACK J3,HUP ... ... ... Output: J1,ELLA_1 J1,ISDR J1,JJK J1,TRS (3 Replies)
Discussion started by: unme
3 Replies

9. UNIX for Beginners Questions & Answers

sed confusion

#!/bin/bash X=(0 2 4 6 7 0 0 0 0) Let me just say from the start that sed confuses the hell out of me! In the above line of code how can I use sed to remove all of the 0's except the first one? I have tried sed -e 's/*$//g' but it removes all of the 0's. Thank you in advance for any and... (3 Replies)
Discussion started by: cogiz
3 Replies

10. UNIX for Beginners Questions & Answers

If then statement confusion

#!/bin/bash PH=(KD 6S TC 3D) #playerhand TCIP=(AH) #topcard in play A=( "${TCIP::1}" ) # A B=( "${TCIP:1}" ) # H C=8 for e in ${PH}; do if ]; then echo "$e " >> /home/cogiz/validcards.txt else echo... (1 Reply)
Discussion started by: cogiz
1 Replies
Locale::Codes::LangExt(3)				User Contributed Perl Documentation				 Locale::Codes::LangExt(3)

NAME
Locale::Codes::LangExt - standard codes for language extension identification SYNOPSIS
use Locale::Codes::LangExt; $lext = code2langext('acm'); # $lext gets 'Mesopotamian Arabic' $code = langext2code('Mesopotamian Arabic'); # $code gets 'acm' @codes = all_langext_codes(); @names = all_langext_names(); DESCRIPTION
The "Locale::Codes::LangExt" module provides access to standard codes used for identifying language extensions, such as those as defined in the IANA language registry. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default IANA language registry codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language extensions. 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: $lext = code2langext('acm','alpha'); $lext = code2langext('acm',LOCALE_LANGEXT_ALPHA); The codesets currently supported are: alpha This is the set of three-letter (lowercase) codes from the IANA language registry, such as 'acm' for Mesopotamian Arabic. This is the default code set. ROUTINES
code2langext ( CODE [,CODESET] ) langext2code ( NAME [,CODESET] ) langext_code2code ( CODE ,CODESET ,CODESET2 ) all_langext_codes ( [CODESET] ) all_langext_names ( [CODESET] ) Locale::Codes::LangExt::rename_langext ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangExt::add_langext ( CODE ,NAME [,CODESET] ) Locale::Codes::LangExt::delete_langext ( CODE [,CODESET] ) Locale::Codes::LangExt::add_langext_alias ( NAME ,NEW_NAME ) Locale::Codes::LangExt::delete_langext_alias ( NAME ) Locale::Codes::LangExt::rename_langext_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangExt::add_langext_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangExt::delete_langext_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.iana.org/assignments/language-subtag-registry The IANA language subtag registry. AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-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.16.3 2013-02-27 Locale::Codes::LangExt(3)
All times are GMT -4. The time now is 07:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy