Sponsored Content
Top Forums Shell Programming and Scripting How to add a character at end of line? Post 302824925 by Don Cragun on Saturday 22nd of June 2013 03:14:49 AM
Old 06-22-2013
Try:
Code:
printf '2s/$/./\nw\nq'|ed -s rmfile

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

End of line character in BAsh

I'm trying to match the end of line character in a shell script under bash. What I have done it got is a loop that reads each line of a file into a temp variable and then I get each letter of that variable and do some work on it. One think I want to do it check if the character I checking if the... (1 Reply)
Discussion started by: Rukshan
1 Replies

2. Shell Programming and Scripting

end of the line character

How do i determine what the end of the line character is in a text file. for eg. is it \n or \f or \t etc.. Is there a unix command for this? (5 Replies)
Discussion started by: zomboo
5 Replies

3. UNIX for Dummies Questions & Answers

stripping last character from end of each line

Hi, sorry for being dumb but I have a file with a variable amount of records (day to day it differs) but is fixed at 80 characters wide. Unfortunately the 80th and last charachter in each line is a "^M" carriage return character which i want to get rid of. Is there a really easy command that i can... (6 Replies)
Discussion started by: hcclnoodles
6 Replies

4. UNIX for Advanced & Expert Users

Deleting end of line $ character in file

Hi, I've got a file where in the middle of the record is a $ end of line character, visible only when I open the file in vi and do :set list. How to I get rid of the character in the middle and keep it at the end. The middle $ character always appears after SW, so that can be used to tag it.... (3 Replies)
Discussion started by: bwrynz1
3 Replies

5. UNIX for Dummies Questions & Answers

How to add new line character at the end of a file

hi all, i have this question: How to add new line character at the end of a file???? i need this because i am loading a file to sybase and i have problems with the last record thanks for your help (5 Replies)
Discussion started by: DebianJ
5 Replies

6. Shell Programming and Scripting

Adding a special character at the end of the line

I used following to add * at the end of the line in file1. It adds * at the end but has a space before it for some lines but some other lines it adds exactly after the last character. How do I take out the space ? sed 's/$/*/' file1 > file2 example: contents of file1 : ... (2 Replies)
Discussion started by: pitagi
2 Replies

7. Shell Programming and Scripting

add character to the end of each line in file

hi all i have 32 lines in file. the length of each line is 82 , i want that in the end of each line , means in postion 83-84 to put two characters 0d(=\015), 0a(=\012) i want that the 0d will be in postion 83 and the 0a will be in postion 84 in each line of the file how shall i do it ? ... (7 Replies)
Discussion started by: naamas03
7 Replies

8. Shell Programming and Scripting

add character to every end-of line in file

Hi All I have a file which conatins record.the length of every records is 47. problem : in the end of record i don't have a "\015" character. i want to add this "\015" charcter in the end of every record. the file contains something like 700 records. i've tried with sed command - nothing. ... (8 Replies)
Discussion started by: naamas03
8 Replies

9. Shell Programming and Scripting

Adding end of line character in the last record

Need to add end of line character to last record in a fixed width file. When i take the record length of each line, for all the records it gives example like 200 except the last line as 199. Due to this my other script fails. Please help me on this. (4 Replies)
Discussion started by: Amrutha24
4 Replies

10. Shell Programming and Scripting

Conditionally add character at end of line

Hi, I would like have a shell script to check every line in a file to see if it ends with ";". If this is NOT the last character ";" should be added. MyFile.csv : web9331801;01/01/2014 23:39:35;;"93962";353150256; web9331802;01/01/2014 23:44:29;;"479288";353153538; web9331803;01/01/2014... (14 Replies)
Discussion started by: vg77
14 Replies
Locale::Codes::LangVar(3pm)				 Perl Programmers Reference Guide			       Locale::Codes::LangVar(3pm)

NAME
Locale::Codes::LangVar - standard codes for language variation identification SYNOPSIS
use Locale::Codes::LangVar; $lvar = code2langvar('acm'); # $lvar gets 'Mesopotamian Arabic' $code = langvar2code('Mesopotamian Arabic'); # $code gets 'acm' @codes = all_langvar_codes(); @names = all_langvar_names(); DESCRIPTION
The "Locale::Codes::LangVar" module provides access to standard codes used for identifying language variations, 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 variations. 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: $lvar = code2langvar('en','alpha-2'); $lvar = code2langvar('en',LOCALE_CODE_ALPHA_2); The codesets currently supported are: alpha This is the set of alphanumeric codes from the IANA language registry, such as 'arevela' for Eastern Armenian. This code set is identified with the symbol "LOCALE_LANGVAR_ALPHA". This is the default code set. ROUTINES
code2langvar ( CODE [,CODESET] ) langvar2code ( NAME [,CODESET] ) langvar_code2code ( CODE ,CODESET ,CODESET2 ) all_langvar_codes ( [CODESET] ) all_langvar_names ( [CODESET] ) Locale::Codes::LangVar::rename_langvar ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangVar::add_langvar ( CODE ,NAME [,CODESET] ) Locale::Codes::LangVar::delete_langvar ( CODE [,CODESET] ) Locale::Codes::LangVar::add_langvar_alias ( NAME ,NEW_NAME ) Locale::Codes::LangVar::delete_langvar_alias ( NAME ) Locale::Codes::LangVar::rename_langvar_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangVar::add_langvar_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangVar::delete_langvar_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.18.2 2014-01-06 Locale::Codes::LangVar(3pm)
All times are GMT -4. The time now is 05:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy