Sponsored Content
Full Discussion: SED Issue
Top Forums UNIX for Dummies Questions & Answers SED Issue Post 82195 by Redg on Monday 29th of August 2005 03:56:36 PM
Old 08-29-2005
Quote:
Originally Posted by vgersh99
not tested...
Code:
sed -e "1,3d;s/^/27A03A,/;s/$/$(date +%Y-%m-%d)/" /mnt/winbox/list_measurement/ds1c/ds1_f.rome_27A03A

Thanks for you reply Vgersh99....
not sure why...but its still writing the date over the first few characters rather than appending it to the end of each line

Results:
2005-08-29luth Forestdale,3:02 am MON AUG 29, 2005,6:25 pm SAT JUN 25, 2005,08/29,02:24,0,0,0,0,N/A,N/A
2005-08-29luth Forestdale,3:02 am MON AUG 29, 2005,6:25 pm SAT JUN 25, 2005,08/29,02:39,0,0,0,0,N/A,N/A
2005-08-29luth Forestdale,3:02 am MON AUG 29, 2005,6:25 pm SAT JUN 25, 2005,08/29,02:54,0,0,0,0,N/A,N/A


Any thought ??
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Issue with sed in script

I have a loop in a script that is given me an error but, when I do it on the command line it works perfectly. The sed statement has to use the variables from a file so the file is partitioned correctly. I am running on HP: <Begin error>: + cat /u01/bteam/CNAM/1121/.partition + read line + +... (3 Replies)
Discussion started by: bthomas
3 Replies

2. Shell Programming and Scripting

Issue with a sed one liner variant - sed 's/ ; /|/g' $TMP1 > $TMP

Execution of the following segment is giving the error - Script extract:- OUT=$DATADIR/sol_rsult_orphn.bcp TMP1=${OUT}_tmp1 TMP=${OUT}_tmp ( isql -w 400 $dbConnect_OPR <<EOF select convert(char(10), s.lead_id) +'|' + s.pho_loc_type, ";", s.sol_rsult_cmnt, ";", +'|'+ s.del_ind... (3 Replies)
Discussion started by: kzmatam
3 Replies

3. Shell Programming and Scripting

Sed Issue....

Can someone help me "port" this to AIX sed? sed '/nas/{n;s/true/false/}' I know it doesn't like the ; but i don't know how else to do it.... never had to sed on an AIX box :D (7 Replies)
Discussion started by: DeviousPete
7 Replies

4. Shell Programming and Scripting

sed issue

Hi All I'm getting this error while executing a sed script sed: 0602-404 Function /</ i\ File from New Cube: cannot be parsed. sed "/</ i\ File from New Cube: />/ i\ File from Old Cube:" difference1.txt > Difference.txt I've a file like this < Y2008 Dec ..... .... ... 345 I want... (6 Replies)
Discussion started by: Celvin VK
6 Replies

5. Shell Programming and Scripting

Issue with Sed Command

Hello , I am trying to replace a word :: complete to Failed . work: complete Sed command which i am using is given below :: sed s/work: complete/Failed/g temp1.txt > temp2.txt (Sed command is grabled if i use the above .. because of space which is there between work: and complete. I... (6 Replies)
Discussion started by: raghav1982
6 Replies

6. Shell Programming and Scripting

Sed Issue

Hi, I am trying to use 3 sed statements in a shell script, but it get foll error. sed : garbage after command. If I use only two sed statements, the script works well. Is there any restriction for sed usage or is there some catch which I am missing. Sample Script is as follows : ... (3 Replies)
Discussion started by: sameersalve
3 Replies

7. Shell Programming and Scripting

one more issue last- sed

hi i have following sed command this replaces "** in filename1 with octal value 007 filename2 when i put it in script it wont work but it works from command line my OS is sun OS ---------- Post updated at 06:38 PM ---------- Previous update was at 06:14 PM ---------- i... (10 Replies)
Discussion started by: er_zeeshan05
10 Replies

8. Shell Programming and Scripting

sed issue

Hi guys. Can somone advise as to what the problem is with the following sed command? 1) read -p "Please enter new username you wish to replace old: " new_username sed "s/$username/$new_username/" information_file ;; This is one of the case statements included but I'm... (1 Reply)
Discussion started by: jjb1989
1 Replies

9. Shell Programming and Scripting

sed issue

I can't get this code to work, could I get some help... sed -i '' "s:${shLogpath1}${cell}:${shLogpath2}${cell}:g" test.txt Any Ideas, I think I need to separate the variables some how? (2 Replies)
Discussion started by: digitalviking
2 Replies

10. Shell Programming and Scripting

sed issue

I'm trying to change a date in a couple of large files using SED. The problem is when I use the -n parameter, it doesn't actually change the file. When I leave out the -n, it sends the whole file to the screen, but it does appear to change it. The problem is, these files are very large and it... (8 Replies)
Discussion started by: Drenhead
8 Replies
DATETIME(3)								 1							       DATETIME(3)

The DateTime class

INTRODUCTION
Representation of date and time. CLASS SYNOPSIS
DateTime DateTimeDateTimeInterface Constants o const string$DateTime::ATOM"Y-m-dTH:i:sP" o const string$DateTime::COOKIE"l, d-M-Y H:i:s T" o const string$DateTime::ISO8601"Y-m-dTH:i:sO" o const string$DateTime::RFC822"D, d M y H:i:s O" o const string$DateTime::RFC850"l, d-M-y H:i:s T" o const string$DateTime::RFC1036"D, d M y H:i:s O" o const string$DateTime::RFC1123"D, d M Y H:i:s O" o const string$DateTime::RFC2822"D, d M Y H:i:s O" o const string$DateTime::RFC3339"Y-m-dTH:i:sP" o const string$DateTime::RSS"D, d M Y H:i:s O" o const string$DateTime::W3C"Y-m-dTH:i:sP" Methods o public DateTime::__construct NULL ([string $time = "now"], [DateTimeZone $timezone]) o public DateTime DateTime::add (DateInterval $interval) o publicstatic DateTime DateTime::createFromFormat (string $format, string $time, [DateTimeZone $timezone]) o publicstatic array DateTime::getLastErrors (void ) o public DateTime DateTime::modify (string $modify) o publicstatic DateTime DateTime::__set_state (array $array) o public DateTime DateTime::setDate (int $year, int $month, int $day) o public DateTime DateTime::setISODate (int $year, int $week, [int $day = 1]) o public DateTime DateTime::setTime (int $hour, int $minute, [int $second]) o public DateTime DateTime::setTimestamp (int $unixtimestamp) o public DateTime DateTime::setTimezone (DateTimeZone $timezone) o public DateTime DateTime::sub (DateInterval $interval) o public DateInterval DateTime::diff (DateTimeInterface $datetime2, [bool $absolute = false]) o public string DateTime::format (string $format) o public int DateTime::getOffset (void ) o public int DateTime::getTimestamp (void ) o public DateTimeZone DateTime::getTimezone (void ) o public DateTime::__wakeup (void ) PREDEFINED CONSTANTS
o DateTime::ATOM - DATE_ATOM - Atom (example: 2005-08-15T15:52:01+00:00) o DateTime::COOKIE - DATE_COOKIE - HTTP Cookies (example: Monday, 15-Aug-2005 15:52:01 UTC) o DateTime::ISO8601 - DATE_ISO8601 - ISO-8601 (example: 2005-08-15T15:52:01+0000) o DateTime::RFC822 - DATE_RFC822 - RFC 822 (example: Mon, 15 Aug 05 15:52:01 +0000) o DateTime::RFC850 - DATE_RFC850 - RFC 850 (example: Monday, 15-Aug-05 15:52:01 UTC) o DateTime::RFC1036 - DATE_RFC1036 - RFC 1036 (example: Mon, 15 Aug 05 15:52:01 +0000) o DateTime::RFC1123 - DATE_RFC1123 - RFC 1123 (example: Mon, 15 Aug 2005 15:52:01 +0000) o DateTime::RFC2822 - DATE_RFC2822 - RFC 2822 (example: Mon, 15 Aug 2005 15:52:01 +0000) o DateTime::RFC3339 - DATE_RFC3339 - Same as DATE_ATOM (since PHP 5.1.3) o DateTime::RSS - DATE_RSS - RSS (example: Mon, 15 Aug 2005 15:52:01 +0000) o DateTime::W3C - DATE_W3C - World Wide Web Consortium (example: 2005-08-15T15:52:01+00:00) CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.5.0 | | | | | | | The class now implements DateTimeInterface. | | | | |5.4.24 | | | | | | | The COOKIE constant was changed to reflect RFC | | | 1036 using a four digit year rather than a two | | | digit year (RFC 850) as prior versions. | | | | | 5.2.2 | | | | | | | DateTime object comparison with the comparison | | | operators changed to work as expected. Previ- | | | ously, all DateTime objects were considered equal | | | (using ==). | | | | +--------+---------------------------------------------------+ PHP Documentation Group DATETIME(3)
All times are GMT -4. The time now is 10:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy