Sponsored Content
Top Forums Shell Programming and Scripting Add additional numbers to file Post 302400385 by Pablo_beezo on Wednesday 3rd of March 2010 05:20:11 AM
Old 03-03-2010
Add additional numbers to file

I need to change the following field from:

Code:
"7/3/2009 7:07:12 PM","12345676","ok","8674"
"6/3/2009 8:07:12 PM","12345676","ok","8674"
"5/1/2009 7:07:12 PM","12345676","ok","8674"
"4/9/2009 3:07:12 AM","12345676","ok","8674"
"3/8/2009 3:07:12 PM","12345676","ok","8674"
"2/7/2009 4:07:12 PM","12345676","ok","8674"
"1/6/2009 5:07:12 PM","12345676","ok","8674"
"8/5/2009 6:07:12 PM","12345676","ok","8674"
"9/4/2009 9:07:12 PM","12345676","ok","8674"
"10/2/2009 10:07:12 PM","12345676","ok","8674"

to

Code:
"07/03/2009 19:07:12","12345676","ok","8674"
"06/03/2009 20:07:12","12345676","ok","8674"
"05/01/2009 19:07:12","12345676","ok","8674"
"04/09/2009 3:07:12","12345676","ok","8674"
"03/08/2009 15:07:12","12345676","ok","8674"
"02/07/2009 16:07:12","12345676","ok","8674"
"01/06/2009 17:07:12","12345676","ok","8674"
"08/05/2009 18:07:12","12345676","ok","8674"
"09/04/2009 21:07:12","12345676","ok","8674"
"10/02/2009 22:07:12 ","12345676","ok","8674"

I was trying sed which does not work, but I have about 1000 records, others with this type of format so it would probably need to be done in a loop?

I cannot get to add the 0 at the front of the date and cannot convert the 24hour process

I am using Korn Shell (solaris)

Last edited by zaxxon; 03-03-2010 at 06:24 AM.. Reason: use code tags please, ty
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Add leading zeroes to numbers in a file

Hello, I am (trying) to write a script that will check to see how many users are logged on to my machine, and if that number is more than 60 I need to kill off all the oldest sessions that are over 60. So far I have been able to check how many users are on and now I am at the part where I have to... (3 Replies)
Discussion started by: raidzero
3 Replies

2. Shell Programming and Scripting

how to add line numbers in text file

Hi all How to add line numbers in text file.. ex abcd cdef result 1. abcd 2. cdef thx in advance (4 Replies)
Discussion started by: suryanarayana
4 Replies

3. AIX

How to add/remove additional DNS and IP to AIX

Hello, How to add/remove additional DNS and IP to AIX ? I wanted to add 3 more new DNS and IP addresses to existing AIX 5.2. (1 Reply)
Discussion started by: balareddy
1 Replies

4. Shell Programming and Scripting

Add numbers in a file

Hello, How to add numbers that are read from a file /tmp/test The content of the file look like 1234 234 432 1235 123 I read the file content in a for loop f=/tmp/test for i in `cat $f` do . . done Santhosh (11 Replies)
Discussion started by: mvsanthosh
11 Replies

5. UNIX for Dummies Questions & Answers

Add floating point numbers from file

How do I use bash to add all the floating point numbers saved in a file like this? 490.47 244.61 263.07 131.59 246.81 115.20 (3 Replies)
Discussion started by: locoroco
3 Replies

6. Shell Programming and Scripting

add a additional column in csv file

Thanks for allwoing me to discuss in this forum GIVEN BELOW A simple shell script which will ask for the user to input a PC name and it will produce the output in CSV with the PC name #! /bin/bash read -p "enter the PC name :" pc #checking for netstat report netstat -pant |sed '1,2d'... (1 Reply)
Discussion started by: ayyappancheta
1 Replies

7. Shell Programming and Scripting

How to add line numbers (multiples of 5: 0,5,10,15,20) to a text file?

Hi, I need to number the lines in my text file. I know how to do this with standard numbering (1,2,3,4, etc) but I need to count in multiples of 5, beginning 0,5,10,15... example existing file: abcd efg hijklm nopqrs desired output 0 abcd 5 efg 10 hijklm 15 ... (11 Replies)
Discussion started by: livbaddeley
11 Replies

8. AIX

Add additional swap place on AIX server

Can anyone help me the detailed procedure and commands to follow to add additional swap on aix server . My system shows following as of now , #lsattr -E -l sys0 -a realmem realmem 13893632 Amount of usable physical memory in Kbytes False #pstat -s PAGE SPACE: USED PAGES FREE... (7 Replies)
Discussion started by: gull05
7 Replies

9. Shell Programming and Scripting

awk to extract multiple values from file and add two additional fields

In the attached file I am trying to use awk to extract multiple values and create the tab-delimited desired output. In the output R_Index is a the sequential # and Pre_Enrichment is defaulted to .. I can extract from the values to the side of the keywords, but most are above and I can not... (2 Replies)
Discussion started by: cmccabe
2 Replies

10. Shell Programming and Scripting

find -exec How to add additional parameter when calling a funtion

Hello Current working script is : # # my_script BEGIN # function a_function { FIRST_PARAM="$1" DO_SOMETHING "$FIRST_PARAM" } export -f a_function START_HERE="/home/some_user/Documents" find $START_HERE" -exec bash -c 'a_function "$0" ' {} \; (5 Replies)
Discussion started by: jcdole
5 Replies
VITE(1) 							 ViTE Manual Pages							   VITE(1)

	 ..___________..._
    __vXXX=========onn=XX=X=s_..
_a=X=============v:|||||i:lvvn=Xn_,
 "!XX===========v||||||||||||iiiv=Xn_
    -"!XX======v||||||||||||iii:::vn=Xs
	 ""!!!Zl|||||||||||iii::lIlvvnXX,.
	      Jl||||||||||i:vvvvlIvvvvv=Zc
	     _e|||||||||ia}"""""!=anvnvnnXno=========aa_.
	     ]l||||||||v}'	   "Xnnnnnn=o=====XXXX=adZ=__
	     =||||||||n(	   .3nnnon=======X=Xs..___X|%!n_,
	    )1||||||i;^ 	    3=noo=======X=XXXZ1v|i|||||iIs,
	    X||||||a!		    3=n========X=X=X=Ii||||||||||iIs,
	  .Jl|||va!		   .==o=o=====X=XXX=li|||||||||||||i3..
	  )na:!"`		    =========X=XX=1:|||||||||||||||||)a
	  ..			   .========X=XXIIi||||||||||||||||||v}
				    X=====X=X=1l|i|||||||||||||<a>}""^
				   .X===X==1Ii||||||||||||<a>""`:
				    +X=nI:i|||:llv_asl}"""`
				     -ni||<c"^.
				      -1%<e.
					!3`

NAME
vite - a visual trace explorer SYNOPSIS
vite vite -h vite [-f|-a] file_path [-e export_path] [-t [time_init]:[time_end]] DESCRIPTION
ViTE is a visual trace explorer. It is a useful tool for profiling and debugging parallel programs (multi-process or multi-core). ViTE reads program execution trace data from file (currently in Paje trace format) and display it in a graphical interface. Program execu- tion data could be a state (drawn as a colored rectangle - color depends of the kind of state), an event (drawn as a green disc) or a com- munication between two processes (drawn as a white arrow). OPTIONS
ViTE accepts the following options: -h Display help. -f file_path Open the file_path file. -a file_path Open the file_path file and display it entirely. -e export_path Export the opened trace file (with -f or -a option) to the export_path file in SVG format. -t [time_init]:[time_end] Just parse trace from time_init to time_end. If time_init is missed, trace will be parsed from the minimum time to time_end. If time_end is missed, trace will be parsed from time_init to the maximum time. AUTHORS
ViTE was created by a group of french engineering school students for the INRIA research center. REPORTING BUGS
Report bugs to ViTE developers <vite-developpeurs@lists.gforge.inria.fr>. COPYRIGHT
ViTE was released under the CeCILL-A licence. The content can be found here: http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt. Copyright (C) 2009 Kevin COULOMB Copyright (C) 2009 Johnny JAZEIX Copyright (C) 2009 Olivier LAGRASSE Copyright (C) 2009 Jule MARCOUEILLE Copyright (C) 2009 Pascal NOISETTE Copyright (C) 2009 Arthur REDONDY Copyright (C) 2009 Clement VUCHENER This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Version 1.2 April 2009 VITE(1)
All times are GMT -4. The time now is 09:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy