Sponsored Content
Top Forums Shell Programming and Scripting Need to replace the date inside a node of several rdf files Post 302871427 by Ribosome on Wednesday 6th of November 2013 07:34:33 AM
Old 11-06-2013
Thank you subbeh and chubler_xl and carlom.
I figured out the working solution:
Quote:
awk '/Date_de_Publication_Periodique/ && /XMLSchema#date/' MM_NN-A1B1C1_ABC.rdf | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/JJJJJJ/'
I forgot to add another requirement that I need to pick only the node with
"Date_de_Publication_Periodique" and "XMLSchema#date" and then replace the date inside with the desired date
While
Quote:
awk '/Date_de_Publication_Periodique/ && /XMLSchema#date/' MM_NN-A1B1C1_ABC.rdf
is returning that line but with sed
Quote:
sed '/Date_de_Publication_Periodique.*XMLSchema#date/s/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/JJJJJJ/' MM_NN-A1B1C1_ABC.rdf
it was returning multiple lines.

Last edited by Ribosome; 11-06-2013 at 08:35 AM.. Reason: corrected username
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to read i-node informations (date of creation)

Hi, I'm looking for a way to get the date of creation for a file. Is it possible ? I know that these informations are in the i-node but I don't know how to access them (if the 'find' command can do it with option -ctime, I have reasons to believe in it). Thanks for helping me ! (1 Reply)
Discussion started by: mullmafr
1 Replies

2. Shell Programming and Scripting

compare date and time inside data of two files

i have two files with identical no of columns. 6th columns is date (MM/DD/YY format) and 7th columns is time (HH:MM:SS) format. I need to compare these two vaules and if the date & time is higher than fileA, save it on fileC; if the value is lower, then save it on fileD CONDITIONS... (7 Replies)
Discussion started by: ajiwww
7 Replies

3. Shell Programming and Scripting

ksh compare dates INSIDE a file (ie date A is > date B)

In KSH, I am pasting 2 almost identical files together and each one has a date and time on each line. I need to determine if the first instance of the date/time is greater than the 2nd instance of the date/time. If the first instance is greater, I just need to echo that line. I thought I would... (4 Replies)
Discussion started by: right_coaster
4 Replies

4. Shell Programming and Scripting

Find Node and replace line(s) preceding in xml file

Hello, I have an xml file whose contacts are like below: <Node>Apple <B>Value1</B> <B>Value2</B> <B>Value3</B> </Node> <Node>Mango <B>Value1</B> <B>Value2</B> <B>Value3</B> </Node> <Node>Apple <B>Value1</B> <B>Value2</B> <B>Value3</B> </Node> <Node>Bannana (3 Replies)
Discussion started by: umarsatti
3 Replies

5. Shell Programming and Scripting

Searching for unknown date inside the file and replace to new date

Hello, Iam a newbies to Shell scripting. Iam trying to replace the date inside the file to new date. is there anyway that we can just use the pattern to search as "..." I have many files want to replace with the same date, and each file contains different date. Thanks for your help. ... (2 Replies)
Discussion started by: Daro
2 Replies

6. Shell Programming and Scripting

Find week of the year for given date using date command inside awk

Hi all, Need an urgent help on the below scenario. script: awk -F"," 'BEGIN { #some variable assignment} { #some calculation and put values in array} END { year=#getting it from array and assume this will be 2014 month=#getting it from array and this will be 05 date=#... (7 Replies)
Discussion started by: vijaidhas
7 Replies

7. Shell Programming and Scripting

Extract Oracle sql queries from .fmb and .rdf files

Hi all, Thanks for your time! Regards, (1 Reply)
Discussion started by: a1_win
1 Replies

8. UNIX for Beginners Questions & Answers

UNIX script to replace old date with current date dynamically in multiple files present in a folder

I am trying to work on a script where it is a *(star) delimited file has a multiple lines starts with RTG and 3rd column=TD8 I want to substring the date part and I want to replace with currentdate minus 15 days. Here is an example. iam using AIX server $ cat temp.txt RTG*888*TD8*20180201~... (1 Reply)
Discussion started by: Shankar455
1 Replies

9. UNIX for Beginners Questions & Answers

Find all .sh files in file system and need to replace the string inside .sh files

Hi All, I need to write a script to find all "*.sh" files in /home file system and if any string find "*.sh" files with the name vijay@gmail.com need to replace with vijay.bhaskar@gmail.com. I just understood about the find the command to search .sh files. Please help me on this. find / -name... (3 Replies)
Discussion started by: bhas85
3 Replies

10. UNIX for Beginners Questions & Answers

How to replace a parameter(variable) date value inside a text files daily with current date?

Hello All, we what we call a parameter file (.txt) where my application read dynamic values when the job is triggered, one of such values are below: abc.txt ------------------ line1 line2 line3 $$EDWS_DATE_INSERT=08-27-2019 line4 $$EDWS_PREV_DATE_INSERT=08-26-2019 I am trying to... (1 Reply)
Discussion started by: pradeepp
1 Replies
CHALOW(1p)																CHALOW(1p)

NAME
chalow - weblog tool that converts ChangeLog to HTML SYNOPSIS
chalow [OPTION]... CHANGELOG... DESCRIPTION
chalow is a weblog tool written in Perl. It converts ChangeLog to HTML and RSS. The options are as follows: -n, --top-n=NUM write NUM days to index.html -o, --output-dir=DIR directory to output -c, --configure-file=FILE configure file -s, --stop-date=DATE date to stop processing -u, --update-by-size overwrite only if sizes are different -C, --css=FILE css file -q, --quiet quiet mode -8, --utf8 utf8 mode -d, --debug debug mode EXAMPLES
Generate index.html, cl.rdf, etc. from ChangeLog: chalow ChangeLog Generate index.html, cl.rdf, etc. from ChangeLog with cl.conf: chalow -c cl.conf ChangeLog Generate index.html, cl.rdf, etc. into the $HOME/public_html/diary directory from ChangeLog* (such as ChangeLog, ChangeLog.2, ChangeLog.old) with cl.conf in utf8 mode: chalow --utf8 -o $HOME/public_html/diary -c cl.conf ChangeLog* BUGS
chalow assumes that ChangeLog file is encoded with EUC-JP or US-ASCII by default. If you want to use UTF-8, use the utf8 mode option (`-8' or `--utf8'). Other encodings, such as ISO-8859-1, ISO-8859-15, EUC-KR, are not supported. This manual page is provided by Debian. It is not integrated in the upstream source. SEE ALSO
More information is available at `/usr/share/doc/chalow' on Debian systems. July 1, 2006 CHALOW(1p)
All times are GMT -4. The time now is 01:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy