Sponsored Content
Top Forums Shell Programming and Scripting replacing one filed at run time in UNix Post 302072947 by vino on Tuesday 9th of May 2006 05:32:18 AM
Old 05-09-2006
Code:
sed -e "s/^[^,]*\(,.*\)/new \1/g" input.txt > output.txt

[^,]* means a character-set containing all those characters which are not , (comma)
\(,.*\) is capture a string which matches the pattern , (comma) followed by anything.

Then replace the character-set with *new* followed by the pattern.

Write everything into output.txt
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help needed - Replacing all date & time occurrences in a file with a string using Sed

Hi, I am new to using Sed. I have a file containg lines like the following: INFORM----Test.pc:168:10/11/05 12:34:26 > some text goes here.. TRACE-----Test.pc:197:10/11/05 12:34:26 > some text goes here.. My requirement is to replace 10/11/05 12:34:26 with a string <RUNDATE> (including <... (4 Replies)
Discussion started by: Hema_M
4 Replies

2. UNIX for Advanced & Expert Users

How To Provide Time Sync Using Nts-150 Time Server On Unix Network?

can anybody tel lme,how to instal NTS -150 on a unix network,it needs some patch to fetch time frm serve,,?? (2 Replies)
Discussion started by: pesty
2 Replies

3. Shell Programming and Scripting

How to get time duration between two human readable time stamp in Unix?

Here is two time I have: Jul 12 16:02:01 Jul 13 01:02:01 and how can I do a simple match to get difference between two time which is 09:00:00 Thanks in advance. (3 Replies)
Discussion started by: ford99
3 Replies

4. UNIX for Dummies Questions & Answers

Converting string date time to unix time in AWK

I'd like to convert a date string in the form of sun aug 19 09:03:10 EDT 2012, to unixtime timestamp using awk. I tried This is how each line of the file looks like, different date and time in this format Sun Aug 19 08:33:45 EDT 2012, user1(108.6.217.236) all: test on the 17th ... (2 Replies)
Discussion started by: bkkid
2 Replies

5. Shell Programming and Scripting

Adding time to date time in UNIX shell scipting

I needed some help in adding a duration (in seconds) to a start time (in hhmmss format) and a start date (in mmddyy format) in order to get an end date and end time. The concept of a leap year is also to be considered while incrementing the day. The code/ function that I have formed so far is as... (3 Replies)
Discussion started by: codehelp04
3 Replies

6. Shell Programming and Scripting

Convert UTC time into current UNIX sever time zone

Hi guys thanks for the help for my previous posts.Now i have a requirement that i download a XMl file which has UTC time stamp.I need to convert UTC time into Unix server timezone. For ex if the time zone of unix server is CDT then i need to convert into CDT.whatever may be the system time... (5 Replies)
Discussion started by: mohanalakshmi
5 Replies

7. Shell Programming and Scripting

Replacing first field of file2 with the second filed of file1 for matching cases

Dear All, Need your help..:D I am not regular on shell scripts..:( I have 2 files.. Content of file1 cellRef 4};"4038_2_MTNL_KALAMBOLI" cellRef 1020};"4112_3_RAINBOW_BLDG" cellRef 134};"4049_2_TATA_HOSPITAL" cellRef 1003};"4242_3_HITESH_CONSTRUCTION" cellRef... (6 Replies)
Discussion started by: ailnilanjan
6 Replies

8. Programming

Arduino UNIX Time - Syncing Computer UNIX Time to Arduino Time with Python

Just finished a quick Python script to send the current unix time over to the Arduino from macOS, so in the absence of GPS or some other way to get the unix timestamp (epoch time) to the Arduino, I can get my macOS and Arduino UNO synced to within a second. Normally, when the Arduino starts... (9 Replies)
Discussion started by: Neo
9 Replies
CURLOPT_WILDCARDMATCH(3)				     curl_easy_setopt options					  CURLOPT_WILDCARDMATCH(3)

NAME
CURLOPT_WILDCARDMATCH - enable directory wildcard transfers SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_WILDCARDMATCH, long onoff); DESCRIPTION
Set onoff to 1 if you want to transfer multiple files according to a file name pattern. The pattern can be specified as part of the CUR- LOPT_URL(3) option, using an fnmatch-like pattern (Shell Pattern Matching) in the last part of URL (file name). By default, libcurl uses its internal wildcard matching implementation. You can provide your own matching function by the CUR- LOPT_FNMATCH_FUNCTION(3) option. A brief introduction of its syntax follows: * - ASTERISK ftp://example.com/some/path/*.txt (for all txt's from the root directory) ? - QUESTION MARK Question mark matches any (exactly one) character. ftp://example.com/some/path/photo?.jpeg [ - BRACKET EXPRESSION The left bracket opens a bracket expression. The question mark and asterisk have no special meaning in a bracket expression. Each bracket expression ends by the right bracket and matches exactly one character. Some examples follow: [a-zA-Z0-9] or [f-gF-G] - character interval [abc] - character enumeration [^abc] or [!abc] - negation [[:name:]] class expression. Supported classes are alnum,lower, space, alpha, digit, print, upper, blank, graph, xdigit. [][-!^] - special case - matches only '-', ']', '[', '!' or '^'. These characters have no special purpose. [[]\] - escape syntax. Matches '[', ']' or ''. Using the rules above, a file name pattern can be constructed: ftp://example.com/some/path/[a-z[:upper:]\].jpeg PROTOCOLS
This feature is only supported for FTP download. EXAMPLE
See https://curl.haxx.se/libcurl/c/ftp-wildcard.html AVAILABILITY
Added in 7.21.0 RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. SEE ALSO
CURLOPT_FNMATCH_FUNCTION(3), CURLOPT_URL(3), libcurl 7.54.0 February 03, 2016 CURLOPT_WILDCARDMATCH(3)
All times are GMT -4. The time now is 06:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy