Sponsored Content
Top Forums Shell Programming and Scripting Replace col 23 - 26 with new value, non delimited file Post 302815493 by blt123 on Saturday 1st of June 2013 01:53:43 AM
Old 06-01-2013
i figured it out i replaced [0-9] with [0-9.]
Thanks for your help - much appreciated!

Oops - just saw your last post - thanks!
 

10 More Discussions You Might Find Interesting

1. Ubuntu

Match col 1 of File 1 with col 1 File 2 and create a 3rd file

Hello, I have a 1.6 GB file that I would like to modify by matching some ids in col1 with the ids in col 1 of file2.txt and save the results into a 3rd file. For example: File 1 has 1411 rows, I ignore how many columns it has (thousands) File 2 has 311 rows, 1 column Would like to... (7 Replies)
Discussion started by: sogi
7 Replies

2. UNIX for Dummies Questions & Answers

Search and replace string only in a particular column in a delimited file

I have file with multiple columns. Column values for a record may be same. Now i have to replace a column value(this can be same for the other columns) with new value. File.txt A,B,C,D,A,B,C,D,A,B,C,D A,B,C,D,A,B,C,D,A,B,C,D A,B,C,D,A,B,C,D,A,B,C,D A,B,C,D,A,B,C,D,A,B,C,D... (1 Reply)
Discussion started by: ksailesh
1 Replies

3. Shell Programming and Scripting

Run a program-print parameters to output file-replace op file contents with max 4th col

Hi Friends, This is the only solution to my task. So, any help is highly appreciated. I have a file cat input1.bed chr1 100 200 abc chr1 120 300 def chr1 145 226 ghi chr2 567 600 unix Now, I have another file by name input2.bed (This file is a binary file not readable by the... (7 Replies)
Discussion started by: jacobs.smith
7 Replies

4. UNIX for Dummies Questions & Answers

What awk 1-liner will replace value in 1stField of a delimited file with the value of '5' ?

Hi, I am a newbie to awk. Here is my problem. Looking for an awk 1-liner to solve it: My Computing Environment: - Solaris10 - I prefer to use csh or sh shells 1. Lets say my input file is File1.dat (delimter = | ) and looks as follows: (File1.dat) ... (1 Reply)
Discussion started by: andy b
1 Replies

5. Shell Programming and Scripting

Replace ^M and the new line that follows it in a delimited file

Hello, I want to Replace/Remove ^M and the new line that follows it in a delimited file. So far I have tried following and nothing seems to work for me . Tr –d ‘\r\n’ < old.dat > new.dat -removes all the linefeed, not just the ones after a ^M. Sed ‘/^M$/{N; s/.\n//;}’ < old.dat >... (7 Replies)
Discussion started by: bluestarmoon
7 Replies

6. UNIX for Dummies Questions & Answers

Replace period in a tab delimited file to a number

I have a file like this. It is tab delimited. Unfortunately, the missing data was filled in with a period "." (see the leading lines 1-5 columns) I want to substitute the periods for misisng data with an integer "-999". however, I do not want the global replace to change the other periods seen... (7 Replies)
Discussion started by: genehunter
7 Replies

7. Shell Programming and Scripting

Replace field in the delimited file

Hi, I have the requirement similar to the one mentioned in the below thread. https://www.unix.com/unix-for-dummies-questions-and-answers/128155-search-replace-string-only-particular-column-delimited-file.html The only difference is that I need to change the field for row 1,2 and the last... (14 Replies)
Discussion started by: chetanojha
14 Replies

8. Shell Programming and Scripting

Replace a number in the last line of a delimited file.

Hi all, I am fairly new to UNIX and I was wondering if you could provide me with some help! Lets say i have a file as below : Line 1 Line 2 Line 3 ABC|12|4|2 Now the number 4 in bold, this number will represent the number of row there is in the file excluding the header and footer... (10 Replies)
Discussion started by: Stinza
10 Replies

9. UNIX for Beginners Questions & Answers

Replace a column in tab delimited file with column in other tab delimited file,based on match

Hello Everyone.. I want to replace the retail col from FileI with cstp1 col from FileP if the strpno matches in both files FileP.txt ... (2 Replies)
Discussion started by: YogeshG
2 Replies

10. Shell Programming and Scripting

Replace delimiter for a particular column in a pipe delimited file

I have an input file as below Emp1|FirstName|MiddleName|LastName|Address|Pincode|PhoneNumber 1234|FirstName1|MiddleName2|LastName3| Add1 || ADD2|123|000000000 Output : 1234|FirstName1|MiddleName2|LastName3| Add1 ,, ADD2|123|000000000 OR 1234,FirstName1,MiddleName2,LastName3, Add1 ||... (2 Replies)
Discussion started by: styris
2 Replies
STRFTIME(3)						   BSD Library Functions Manual 					       STRFTIME(3)

NAME
strftime, strftime_l -- format date and time LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <time.h> size_t strftime(char *restrict s, size_t maxsize, const char *restrict format, const struct tm *restrict timeptr); #include <time.h> #include <xlocale.h> size_t strftime_l(char *restrict s, size_t maxsize, const char *restrict format, const struct tm *restrict timeptr, locale_t loc); DESCRIPTION
The strftime() function formats the information from timeptr into the buffer s, according to the string pointed to by format. The format string consists of zero or more conversion specifications and ordinary characters. All ordinary characters are copied directly into the buffer. A conversion specification consists of a percent sign ``'%''' and one other character. No more than maxsize characters will be placed into the array. If the total number of resulting characters, including the terminating NUL character, is not more than maxsize, strftime() returns the number of characters in the array, not counting the terminating NUL. Otherwise, zero is returned and the buffer contents are indeterminate. Although the strftime() function uses the current locale, the strftime_l() function may be passed a locale directly. See xlocale(3) for more information. The conversion specifications are copied to the buffer after expansion as follows:- %A is replaced by national representation of the full weekday name. %a is replaced by national representation of the abbreviated weekday name. %B is replaced by national representation of the full month name. %b is replaced by national representation of the abbreviated month name. %C is replaced by (year / 100) as decimal number; single digits are preceded by a zero. %c is replaced by national representation of time and date. %D is equivalent to ``%m/%d/%y''. %d is replaced by the day of the month as a decimal number (01-31). %E* %O* POSIX locale extensions. The sequences %Ec %EC %Ex %EX %Ey %EY %Od %Oe %OH %OI %Om %OM %OS %Ou %OU %OV %Ow %OW %Oy are supposed to provide alternate representations. Additionally %OB implemented to represent alternative months names (used standalone, without day mentioned). %e is replaced by the day of the month as a decimal number (1-31); single digits are preceded by a blank. %F is equivalent to ``%Y-%m-%d''. %G is replaced by a year as a decimal number with century. This year is the one that contains the greater part of the week (Monday as the first day of the week). %g is replaced by the same year as in ``%G'', but as a decimal number without century (00-99). %H is replaced by the hour (24-hour clock) as a decimal number (00-23). %h the same as %b. %I is replaced by the hour (12-hour clock) as a decimal number (01-12). %j is replaced by the day of the year as a decimal number (001-366). %k is replaced by the hour (24-hour clock) as a decimal number (0-23); single digits are preceded by a blank. %l is replaced by the hour (12-hour clock) as a decimal number (1-12); single digits are preceded by a blank. %M is replaced by the minute as a decimal number (00-59). %m is replaced by the month as a decimal number (01-12). %n is replaced by a newline. %O* the same as %E*. %p is replaced by national representation of either "ante meridiem" (a.m.) or "post meridiem" (p.m.) as appropriate. %R is equivalent to ``%H:%M''. %r is equivalent to ``%I:%M:%S %p''. %S is replaced by the second as a decimal number (00-60). %s is replaced by the number of seconds since the Epoch, UTC (see mktime(3)). %T is equivalent to ``%H:%M:%S''. %t is replaced by a tab. %U is replaced by the week number of the year (Sunday as the first day of the week) as a decimal number (00-53). %u is replaced by the weekday (Monday as the first day of the week) as a decimal number (1-7). %V is replaced by the week number of the year (Monday as the first day of the week) as a decimal number (01-53). If the week containing January 1 has four or more days in the new year, then it is week 1; otherwise it is the last week of the previous year, and the next week is week 1. %v is equivalent to ``%e-%b-%Y''. %W is replaced by the week number of the year (Monday as the first day of the week) as a decimal number (00-53). %w is replaced by the weekday (Sunday as the first day of the week) as a decimal number (0-6). %X is replaced by national representation of the time. %x is replaced by national representation of the date. %Y is replaced by the year with century as a decimal number. %y is replaced by the year without century as a decimal number (00-99). %Z is replaced by the time zone name. %z is replaced by the time zone offset from UTC; a leading plus sign stands for east of UTC, a minus sign for west of UTC, hours and min- utes follow with two digits each and no delimiter between them (common form for RFC 822 date headers). %+ is replaced by national representation of the date and time (the format is similar to that produced by date(1)). %-* GNU libc extension. Do not do any padding when performing numerical outputs. %_* GNU libc extension. Explicitly specify space for padding. %0* GNU libc extension. Explicitly specify zero for padding. %% is replaced by '%'. SEE ALSO
date(1), printf(1), ctime(3), printf(3), strptime(3), wcsftime(3), xlocale(3) STANDARDS
The strftime() function conforms to ISO/IEC 9899:1990 (``ISO C90'') with a lot of extensions including '''', '%E*', '%e', '%G', '%g', '%h', '%k', '%l', '%n', '%O*', '%R', '%r', '%s', '%T', '%t', '%u', '%V', '%z', and '%+'. The peculiar week number and year in the replacements of '%G', '%g', and '%V' are defined in ISO 8601: 1988. BUGS
There is no conversion specification for the phase of the moon. The strftime() function does not correctly handle multibyte characters in the format argument. BSD
November 4, 2004 BSD
All times are GMT -4. The time now is 06:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy