Sponsored Content
Top Forums Shell Programming and Scripting Convert the first letter of each line to uppercase Post 302469058 by ramky79 on Thursday 4th of November 2010 01:58:59 PM
Old 11-04-2010
Convert the first letter of each line to uppercase

Hi,
I have the following file:
Code:
/* ----------------- ADP2DAILY_Box ----------------- */
insert_job: ADP2DAILY_Box
job_type: b
owner: mbprwork
permission: gx,wx
date_conditions: 1
days_of_week: mo,tu,we,th,fr
exclude_calendar: mtg_holidays
start_times: "1:00"
description: "Process Daily New pools agency data"
alarm_if_fail: 1
/* ----------------- ADP2DAILY_JobSetPermission ----------------- */
insert_job: ADP2DAILY_JobSetPermission
job_type: c
box_name: ADP2DAILY_Box
command: $RUNDIR/set_geo_perm_mtgrep.csh
machine: cffimtgsaslx01
owner: mbprwork
permission: gx,wx
condition: success(ADP2_4BDRunBox) and success(ADP2_9BDRunBox)
n_retrys: 1
std_out_file: > $JOBSPATH/$AUTO_JOB_NAME
std_err_file: > $ERRSPATH/$AUTO_JOB_NAME
alarm_if_fail: 1
profile: /home/MtgMdlApps/AGENCY/bin/Adp2DailyAgencyBoxEnv.sh

I want this as my output:
Code:
/* ----------------- ADP2DAILY_Box ----------------- */
Insert_job: ADP2DAILY_Box
Job_type: b
Owner: mbprwork
Permission: gx,wx
Date_conditions: 1
Days_of_week: mo,tu,we,th,fr
Exclude_calendar: mtg_holidays
Start_times: "1:00"
Description: "Process Daily New pools agency data"
Alarm_if_fail: 1
/* ----------------- ADP2DAILY_JobSetPermission ----------------- */
Insert_job: ADP2DAILY_JobSetPermission
Job_type: c
Box_name: ADP2DAILY_Box
Command: $RUNDIR/set_geo_perm_mtgrep.csh
Machine: cffimtgsaslx01
Owner: mbprwork
Permission: gx,wx
Condition: success(ADP2_4BDRunBox) and success(ADP2_9BDRunBox)
N_retrys: 1
Std_out_file: > $JOBSPATH/$AUTO_JOB_NAME
Std_err_file: > $ERRSPATH/$AUTO_JOB_NAME
Alarm_if_fail: 1
Profile: /home/MtgMdlApps/AGENCY/bin/Adp2DailyAgencyBoxEnv.sh

how do i achieve this in a unix shell script
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How convert lowercase or uppercase

It will only accept one argument where it should be upper or lowercase. if user choose to convert filnames to upper case than it should convert to upper or vice versa. if no action taken by the user then should not do anything any of the files in the current directory. (5 Replies)
Discussion started by: Alex20
5 Replies

2. Shell Programming and Scripting

sed help to convert from lowercase to uppercase and vice versa!

Hello, can sed be used to convert all letters of a file from uppercase to lowercase and vice versa?i know tr command can be used but with sed is it possible? i came up with this :- sed 'y///' file1 actually the above command is also not working! Please help me. Thanks in advance :) (6 Replies)
Discussion started by: salman4u
6 Replies

3. UNIX for Dummies Questions & Answers

Convert string to uppercase

i have this piece of small code that checks for *.CSV files. NUMFILES=`ls -1 *.CSV | wc -l` for filename in $(ls -1 *.CSV) do ... done it works only if the files has an uppercase of *.CSV extension. however, when there is a file of the same type but has lowercase *.csv... (1 Reply)
Discussion started by: wtolentino
1 Replies

4. Shell Programming and Scripting

Convert to upper case first letter of each word in column 2

Hi guys, I have a file separated by ",". I´m trying to change to upper case the first letter of each word in column 2 to establish a standard format on this column. I hope somebody could help me to complete the SED or AWK script below. The file looks like this: (Some lines in column 2... (16 Replies)
Discussion started by: cgkmal
16 Replies

5. Shell Programming and Scripting

how to convert user input to uppercase

Hi, how to convert user input (lowercase) to uppercase in the dos batch file ? echo. SET /p user1=Enter username: SET user2=%user1%V echo. echo %user1% echo. echo %user2% echo. With Regards (7 Replies)
Discussion started by: milink
7 Replies

6. Shell Programming and Scripting

insert "_" before uppercase letter with awk

Hi, I am trying to insert a "_" character in front of capital letters in a string. For instance: HappyDaysAreHereAgain needs to become Happy_Days_Are_Here_Again I know how to do this with sed, but I am writing an awk script, which does several things. Also, I have already set FS in order... (9 Replies)
Discussion started by: kato
9 Replies

7. Shell Programming and Scripting

Convert lowercase to uppercase

listprocs.sh contains ps -ef | grep "swikar" 1) Write a shell script to convert an input file to all upper case. Name your shell script toupper.sh. Hint: tr ' ' ' ' will convert all lower case letters to upper case To use your script, try the following command: cat... (1 Reply)
Discussion started by: swikar
1 Replies

8. Shell Programming and Scripting

convert to uppercase in specific table

Hi All, I'm a newbie here, i'm just wondering is it possible to convert into uppercase the records in specific field? ex. table name = mytable field1 field2 field3 abd erfdF fdsfdsfsd how can i convert into uppercase the field2 using sybase? Please advise, ... (2 Replies)
Discussion started by: nikki1200
2 Replies

9. Shell Programming and Scripting

Find Files and then convert them to Uppercase

Hi All, So I'm new to scripting and I've been put in a position to convert a bunch of files with specific extensions in a folder and all its subfolders to uppercase including their extension. I figure so far I could do something like this: ... ... and then input $line into another bash... (12 Replies)
Discussion started by: ideal2545
12 Replies

10. Shell Programming and Scripting

SED (or other) upper to lowercase, with first letter of first word in each sentence uppercase

The title pretty much defines the problem. I have text files that are all in caps. I would like to convert them to lowercase, but have the first letter of the first word in each sentence in uppercase. I already have SED on the server for fixing / tweaking text files, but I'm open to other... (5 Replies)
Discussion started by: dockline
5 Replies
Locale::Codes::LangFam(3pm)				 Perl Programmers Reference Guide			       Locale::Codes::LangFam(3pm)

NAME
Locale::Codes::LangFam - standard codes for language extension identification SYNOPSIS
use Locale::Codes::LangFam; $lext = code2langfam('apa'); # $lext gets 'Apache languages' $code = langfam2code('Apache languages'); # $code gets 'apa' @codes = all_langfam_codes(); @names = all_langfam_names(); DESCRIPTION
The "Locale::Codes::LangFam" module provides access to standard codes used for identifying language families, such as those as defined in ISO 639-5. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default ISO 639-5 language family codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language families. 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 = code2langfam('apa','alpha'); $lext = code2langfam('apa',LOCALE_LANGFAM_ALPHA); The codesets currently supported are: alpha This is the set of three-letter (lowercase) codes from ISO 639-5 such as 'apa' for Apache languages. This is the default code set. ROUTINES
code2langfam ( CODE [,CODESET] ) langfam2code ( NAME [,CODESET] ) langfam_code2code ( CODE ,CODESET ,CODESET2 ) all_langfam_codes ( [CODESET] ) all_langfam_names ( [CODESET] ) Locale::Codes::LangFam::rename_langfam ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangFam::add_langfam ( CODE ,NAME [,CODESET] ) Locale::Codes::LangFam::delete_langfam ( CODE [,CODESET] ) Locale::Codes::LangFam::add_langfam_alias ( NAME ,NEW_NAME ) Locale::Codes::LangFam::delete_langfam_alias ( NAME ) Locale::Codes::LangFam::rename_langfam_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangFam::add_langfam_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangFam::delete_langfam_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.loc.gov/standards/iso639-5/id.php ISO 639-5 . 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 2013-11-04 Locale::Codes::LangFam(3pm)
All times are GMT -4. The time now is 01:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy