Sponsored Content
Full Discussion: changing format
Top Forums Shell Programming and Scripting changing format Post 302163039 by shary on Thursday 31st of January 2008 12:05:13 AM
Old 01-31-2008
changing format

Dear Experts,

Currently my script is gereating the output like this as mentioned below.
8718,8718,0,8777
7450,7450,0,7483
5063,5063,0,5091
3840,3840,0,3855
3129,3129,0,3142
2400,2400,0,2419
2597,2597,0,2604
3055,3055,0,3078
4249,4249,0,4266
4927,4927,0,4957
8920,8920,0,8978
19567,19567,0,19675
15249,15249,0,15330
13930,13930,0,14015
13694,13694,0,13742
13066,13066,0,13122
12477,12477,0,12548
12791,12791,0,12855
13754,13754,0,13842
13181,13181,0,13259
12991,12991,0,13048
12435,12435,0,12484
13545,13545,0,13624
14584,14584,0,14656

But i want to put one more filed in the beginning which the hours from 0 to 23 and then i want to remove the comma "," separator by space " ". so please any boday can help me that how i can do this. below is the example what i need.

0 11280 11238 42 8310 278614712365
1 9452 9418 34 6524 316133393258
2 6913 6893 20 4479 181166977197
3 5707 5682 25 3252 81632013829
4 5427 5412 15 2647 46489111672
5 5267 5244 23 2074 44848549151
6 5232 5192 40 2190 43271031178
7 4870 4825 45 2867 41230177377
8 6221 6143 78 3666 45317367933
9 7338 7285 53 4372 49832797662
10 12494 12415 79 9675 21794650247
11 11257 11189 68 8416 22724861286
12 9372 9314 58 6843 21935582761
13 8494 8439 55 6190 22792627162
14 8486 8417 69 6550 25862616004
15 10179 10114 65 7130 27358047451
16 10067 10014 53 6600 26836305812
17 10574 10510 64 6824 26546313813
18 10509 10417 92 7389 28518610203
19 10356 10262 94 7934 29440052363
20 11865 11766 99 8859 31288108440
21 11570 11396 174 8481 29865106485
22 11416 11307 109 9080 33985893791
23 11855 11745 110 8707 35429158339


dont consider the values its different just to show u the format what i need.
please help me its urgent.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Changing the date format

Hi, I know there is a Q/A section and lots of posts regarding date command here. I am sorry to start a new thread. I am very new to shell scripting (actually i am working on my first program), so please forgive my ignorance. I could not find an answer to my problem else where so i posted it... (10 Replies)
Discussion started by: Dream86
10 Replies

2. UNIX for Dummies Questions & Answers

Getting month and changing format

Hello, I would like to get todays moth and write it in this format: _06_ Any ideas? (7 Replies)
Discussion started by: marringi
7 Replies

3. Shell Programming and Scripting

changing month in Mmm format to mm FORMAT

i have an variable mydate=2008Nov07 i want o/p as in variable mymonth=11 (i.e nov comes on 11 number month) i want some command to do this for any month without using any loop. plz help me (1 Reply)
Discussion started by: RahulJoshi
1 Replies

4. Shell Programming and Scripting

Changing Date format

How to change a date stored in a variable to YYYYMMDD. Variable output is in DD-MON-YY,required format is 'YYYYMMDD' Thanks, Sud (1 Reply)
Discussion started by: sud
1 Replies

5. UNIX for Dummies Questions & Answers

Changing from Excel date format to MySQL date format

I have a list of dates in the following format: mm/dd/yyyy and want to change these to the MySQL standard format: yyyy-mm-dd. The dates in the original file may or may not be zero padded, so April is sometimes "04" and other times simply "4". This is what I use to change the format: sed -i '' -e... (2 Replies)
Discussion started by: figaro
2 Replies

6. Shell Programming and Scripting

changing the format of the list

I have a file such that List : a, b, c, d I want to list this as List a b c d however the trick is the number of arguments in the list is varies. There might be 0-7 variables . Can you help me? Please use code tags when posting data and code samples! (5 Replies)
Discussion started by: ozum
5 Replies

7. UNIX for Advanced & Expert Users

Changing the date format

Hi All, I am new to this forum, could any one help me out in resolving the below issue. Input of the flat file contains several lines of text for example find below: 5022090,2,4,7154,88,,,,,4/1/2011 0:00,Z,L,2 5022090,3,1,6648,88,,,,,4/1/2011 0:00,Z,,1 5022090,4,1,6648,88,,,,,4/1/2011... (0 Replies)
Discussion started by: av_sagar
0 Replies

8. Shell Programming and Scripting

Changing the date format

Hi all, I have a file with below data af23b|11-FEB-12|acc7 ad23b|12-JAN-12|acc4 as23b|15-DEC-11|acc5 z123b|18-FEB-12|acc1 I need the output as below:-(date in yyyymmdd format) af23b|20120211|acc7 ad23b|20120112|acc4 as23b|20111215|acc5 z123b|20120218|acc1 Please help me on this.... (7 Replies)
Discussion started by: gani_85
7 Replies

9. Shell Programming and Scripting

Changing Date Format

How can i make the date command output yesterday's date, current date and the date 4 days ago, in the following format: 2012-10-03 code: date +% ???? (3 Replies)
Discussion started by: SkySmart
3 Replies

10. Shell Programming and Scripting

Changing filename format

i need and outline to write a script that takes and old format and convert to a new format example: tupac - changes.mp3 and converts all mp3 files to the format of tupac/changes.mp3 thanks for taking your time (1 Reply)
Discussion started by: domdom110
1 Replies
sttydefs(1M)						  System Administration Commands					      sttydefs(1M)

NAME
sttydefs - maintain line settings and hunt sequences for TTY ports SYNOPSIS
/usr/sbin/sttydefs -a ttylabel [-b] [-f final-flags] [-i initial-flags] [-n nextlabel] /usr/sbin/sttydefs -l [ttylabel] /usr/sbin/sttydefs -r ttylabel DESCRIPTION
sttydefs is an administrative command that maintains the line settings and hunt sequences for the system's TTY ports by making entries in, and deleting entries from the /etc/ttydefs file. sttydefs with a -a or -r option may be invoked only by the super-user. sttydefs with -l may be invoked by any user on the system. OPTIONS
The following options are supported: -a ttylabel Add a record to the ttydefs file, using ttylabel as its label. The following describes the effect of the -b, -n, -i, or -f options when used in conjunction with the -a option: -b Enable autobaud. Autobaud allows the system to set the line speed of a given TTY port to the line speed of the device connected to the port without the user's intervention. -f final-flags Specify the value to be used in the final-flags field in /etc/ttydefs. final-flags must be in a format recognized by the stty command. final-flags are the termio(7I) settings used by ttymon after receiving a successful connection request and immediately before invoking the service on the port. If this option is not specified, sttydefs will set final-flags equal to the termio(7I) flags 9600 and sane. -i initial-flags Specify the value to be used in the initial-flags field in /etc/ttydefs. initial-flags must be in a format recog- nized by the stty command. These flags are used by ttymon when searching for the correct baud rate. They are set prior to writing the prompt. If this option is not specified, sttydefs will set initial-flags equal to the termio(7I) flag 9600. -n nextlabel Specify the value to be used in the nextlabel field in /etc/ttydefs. If this option is not specified, sttydefs will set nextlabel equal to ttylabel. -l[ttylabel] If a ttylabel is specified, sttydefs displays the record from /etc/ttydefs whose TTY label matches the specified ttylabel. If no ttylabel is specified, sttydefs displays the entire contents of /etc/ttydefs. sttydefs verifies that each entry it displays is correct and that the entry's nextlabel field references an existing -r ttylabel Remove any record in the ttydefs file that has ttylabel as its label. OUTPUT
If successful, sttydefs will exit with a status of 0. sttydefs -l will generate the requested information and send it to standard output. EXAMPLES
Example 1: A sample of sttydefs command. The following command lists all the entries in the ttydefs file and prints an error message for each invalid entry that is detected. example# sttydefs -l The following shows a command that requests information for a single label and its output: example# sttydefs -l 9600 ------------------------------------------------------------------ 9600:9600 hupcl erase ^h:9600 sane ixany tab3 hupcl erase ^h::4800 ------------------------------------------------------------------ ttylabel: 9600 initial flags: 9600 hupcl erase ^h final flags: 9600 sane ixany tab3 hupcl erase ^h autobaud: no nextlabel: 4800 The following sequence of commands will add the labels 1200, 2400, 4800, and 9600 and put them in a circular list: sttydefs -a 1200 -n 2400 -i 1200 -f "1200 sane" sttydefs -a 2400 -n 4800 -i 2400 -f "2400 sane" sttydefs -a 4800 -n 9600 -i 4800 -f "4800 sane" sttydefs -a 9600 -n 1200 -i 9600 -f "9600 sane" FILES
/etc/ttydefs ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5), termio(7I) SunOS 5.10 14 Sep 1992 sttydefs(1M)
All times are GMT -4. The time now is 02:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy