Search Results

Search: Posts Made By: sree_chari
2,834
Posted By Aia
for i in *.xml do awk 'BEGIN {FS="[ <]"} ...
for i in *.xml
do
awk 'BEGIN {FS="[ <]"} /TimeStamp=/ {f=FILENAME; sub(".*Msg","",f); f=$2 f; print "mv " FILENAME " " f; exit}' "$i"
done

Or

#! /usr/bin/awk -f
# script.awk

BEGIN...
2,834
Posted By Franklin52
Try this but check the output before you pipe the...
Try this but check the output before you pipe the output to sh (colored part):
for i in *.xml
do
awk -F"[ <]" 'BEGIN{f=FILENAME; sub(".*Msg","",f)}
/TimeStamp=/ {f=$2 f; print "mv " FILENAME...
3,738
Posted By clx
If you are sure you have only files you want to...
If you are sure you have only files you want to rename;

ls * | awk -F ".xml" '{print "mv "$0,$1$2".xml"}' | sh
Please check first without the RED, if every thing seems file, go with that.

...
2,897
Posted By Franklin52
Something like this? awk -F"[<>]" 'NR==2{print...
Something like this?
awk -F"[<>]" 'NR==2{print $2}' file

or maybe this what you mean:
awk '/<TestXMLMessage>/{f=1};f;/<\/TestXMLMessage>/{f=0}' file
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 02:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy