Hi
I have just come across your app and I'm hoping its going to be able to help save my skin!
I have approx 40K .xml files all looking similiar to :-
<?xml version="1.0" encoding="UTF-16" standalone="yes"?>
<fields>
<field id="Client_Name">XXXXXXXXXX</field>
<field id="Date_In_System">20041209</field>
<field id="Status"></field>
<field id="Document_Class"></field>
<field id="Document_Overview"></field>
<field id="Administrator"></field>
</fields>
What I want to do is insert into each file the filename like :-
<?xml version="1.0" encoding="UTF-16" standalone="yes"?>
<fields>
<field id="Filename">Filename1</field>
<field id="Client_Name">XXXXXXXXXX</field>
<field id="Date_In_System">20041209</field>
<field id="Status"></field>
<field id="Document_Class"></field>
<field id="Document_Overview"></field>
<field id="Administrator"></field>
</fields>
Is this possible with your app?
sorry if this is a basic question but I have a rather short timeframe to try and resolve this
many thanks
Inserting Filename
Hi,
Your skin will be quickly saved with AFR!
Read the page:
http://www.abacre.com/afr/manual/optsba ... ilerenamer
So:
Start the program. In main menu - Action - Options - Batch replace
check ON: "Include File Name into Search Scope".
set correct modifiers:
Modifier S: ON
Modifier G: ON
Press OK.
In Batch Replace tab of the main window:
check ON: "Use regular expressions"
put Search for:
.*\\(.+\.xml)\r\n(.*)<fields>
Replace with:
\r\n$2<fields>\r\n<field id="Filename">$1</field>
That's all. I verified it perfectly works. So if you have the file
name:
C:\Program Files\Advanced Find and Replace\test it.xml
it will produce the resulting file:
If you need to include the complete file name (with full path) use the
Search for:
(.+\.xml)\r\n(.*)<fields>
Replace with (is the same as above):
\r\n$2<fields>\r\n<field id="Filename">$1</field>
That's it. In this case the resulting file will be:
Does it work on your computer?
Your skin will be quickly saved with AFR!
Read the page:
http://www.abacre.com/afr/manual/optsba ... ilerenamer
So:
Start the program. In main menu - Action - Options - Batch replace
check ON: "Include File Name into Search Scope".
set correct modifiers:
Modifier S: ON
Modifier G: ON
Press OK.
In Batch Replace tab of the main window:
check ON: "Use regular expressions"
put Search for:
.*\\(.+\.xml)\r\n(.*)<fields>
Replace with:
\r\n$2<fields>\r\n<field id="Filename">$1</field>
That's all. I verified it perfectly works. So if you have the file
name:
C:\Program Files\Advanced Find and Replace\test it.xml
it will produce the resulting file:
Code: Select all
<?xml version="1.0" encoding="UTF-16" standalone="yes"?>
<fields>
<field id="Filename">test it.xml</field>
<field id="Client_Name">XXXXXXXXXX</field>
<field id="Date_In_System">20041209</field>
<field id="Status"></field>
<field id="Document_Class"></field>
<field id="Document_Overview"></field>
<field id="Administrator"></field>
</fields>
If you need to include the complete file name (with full path) use the
Search for:
(.+\.xml)\r\n(.*)<fields>
Replace with (is the same as above):
\r\n$2<fields>\r\n<field id="Filename">$1</field>
That's it. In this case the resulting file will be:
Code: Select all
<?xml version="1.0" encoding="UTF-16" standalone="yes"?>
<fields>
<field id="Filename">C:\Program Files\Advanced Find and Replace\test it.xml</field>
<field id="Client_Name">XXXXXXXXXX</field>
<field id="Date_In_System">20041209</field>
<field id="Status"></field>
<field id="Document_Class"></field>
<field id="Document_Overview"></field>
<field id="Administrator"></field>
</fields>
Does it work on your computer?
Well, then it will be about the same as described in:
http://www.abacre.com/afr/manual/optsba ... ilerenamer
So use search for:
.*\\(.+)\.xml\r\n(.*)<fields>
That's all!
http://www.abacre.com/afr/manual/optsba ... ilerenamer
So use search for:
.*\\(.+)\.xml\r\n(.*)<fields>
That's all!
Ok I have a really strange one now.
Hi
I have used the above and it work fantastically.
However, i have since rebuilt my PC and re-installed the app but now I cannot get it to search any .xml file at all, for either finding or batch replacing.
I am using 2.3 registered.
I'm guessing I have selected a setting somewhere?
Even more wierd, I cant search or replace on files it has previously worked on?
any ideas?
ps. I have emailed you the source and default.cfg file.
I have used the above and it work fantastically.
However, i have since rebuilt my PC and re-installed the app but now I cannot get it to search any .xml file at all, for either finding or batch replacing.
I am using 2.3 registered.
I'm guessing I have selected a setting somewhere?
Even more wierd, I cant search or replace on files it has previously worked on?
any ideas?
ps. I have emailed you the source and default.cfg file.