Hello,
I have 1000 text files in which a sequence of digits (eg file1: 29292, file2: 48484 ...) Is the TC can save a list of text files with the content?
arthur.txt
D:\directory\file1.txt 29292
D:\directory\file2.txt 48484
...
...
...
D:\directory\plik1000.txt 74747
Thank you in advance for your tips!
Regards
Arthur
Writing the content of the file to .txt
Moderators: Hacker, petermad, Stefan2, white
To you know this plugin and VBS?
'*** Script for Script Content Plugin 0.2
'*** Lev Freidin (c) 2005-2008
'*** http://www.totalcmd.net/plugring/script_wdx.html
And a modification of this VBS could help:
Peter
'*** Script for Script Content Plugin 0.2
'*** Lev Freidin (c) 2005-2008
'*** http://www.totalcmd.net/plugring/script_wdx.html
And a modification of this VBS could help:
Code: Select all
Set fso = CreateObject("Scripting.FileSystemObject")
Set oTextStream = fso.OpenTextFile(filename)
If not oTextStream.AtEndOfStream Then
s = oTextStream.ReadLine
Pos1 = InStr(1, s, """")
Pos2 = InStrRev(s, """")
If (Pos1 > 0) and (Pos2 > Pos1) Then
content = Mid(s, Pos1 + 1, Pos2 - Pos1 - 1)
Else
content = " ¦ Keinen Text mit "" in erster Zeile"
End If
End If
oTextStream.Close
TC 10.xx / #266191
Win 10 x64
Win 10 x64
Alternative to complicated scripts:
You could use the RegXtract plugin for this.
Do these files just contain that one number each, and nothing else?
If yes, mark the files in Total Commander, open the Pack... Dialog and use the RegXtract settings:
Regular Expression:
Replace String:
[x] Line mode
(leave everything else at default setting)
Now you have an output file in the format:
[face=courier]>>>> "D:\directory\file1.txt":
>> Line 1:
29292
>>>> "D:\directory\file2.txt":
>> Line 1:
48484
...[/face]
If this format isn't satisfactory, use this file again with RegXtract, with the following settings:
Regular Expression:
Replace String:
[x] Dotall
[x] Line anchors
(leave everything else at default setting)
The output file should now contain:
[face=courier]D:\directory\file1.txt 29292
D:\directory\file2.txt 48484[/face]
just as you wanted.
You could use the RegXtract plugin for this.
Do these files just contain that one number each, and nothing else?
If yes, mark the files in Total Commander, open the Pack... Dialog and use the RegXtract settings:
Regular Expression:
Code: Select all
.*
Code: Select all
$0
(leave everything else at default setting)
Now you have an output file in the format:
[face=courier]>>>> "D:\directory\file1.txt":
>> Line 1:
29292
>>>> "D:\directory\file2.txt":
>> Line 1:
48484
...[/face]
If this format isn't satisfactory, use this file again with RegXtract, with the following settings:
Regular Expression:
Code: Select all
>>>> "(.*?)":\R>> Line \d+:\R(^.*?$)
Code: Select all
$1 $2
[x] Line anchors
(leave everything else at default setting)
The output file should now contain:
[face=courier]D:\directory\file1.txt 29292
D:\directory\file2.txt 48484[/face]
just as you wanted.