Kommas vor und nach Text einfügen
Excel 97, .txt Datei
Hallo,
gibt es eine Möglichkeit über Excel oder Word 97 in einer Textdatei, kann auch importiert werden, vor und nach dem Text neun Kommas enfügen zu lassen?
Danke.
gibt es eine Möglichkeit über Excel oder Word 97 in einer Textdatei, kann auch importiert werden, vor und nach dem Text neun Kommas enfügen zu lassen?
Danke.
Please also mark the comments that contributed to the solution of the article
Content-Key: 52065
Url: https://administrator.de/contentid/52065
Printed on: April 23, 2024 at 14:04 o'clock
16 Comments
Latest comment
Hallo thekingofqueens!
Versuch mal das folgende Script:
Grüße
bastla
Versuch mal das folgende Script:
Const sInFile = "D:\Test.txt"
Const sOutFile = "D:\TestMitC.txt"
Const cVor = ","
Const iVor = 9
Const cNach = ","
Const iNach = 9
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
Set oInFile = fso.OpenTextFile(sInFile, 1)
Set oOutFile = fso.OpenTextFile(sOutFile, 2, True)
Do While Not oInFile.AtEndOfStream
sZeile = oInFile.ReadLine
oOutFile.WriteLine String(iVor, cVor) & sZeile & String(iNach, cNach)
Loop
oInFile.Close
oOutFile.Close
Grüße
bastla
Hey cool, das setzt mir die Kommas/Kommata mal vor dem Text, aber nicht danach
Das ist mir nicht ganz klar, bei mir werden beide gesetzt.Wo ist denn diese Bewertunsfunktion hin?
Die hat Frank temporär entfernt, sollte aber eigentlich schon länger wieder da sein. Vielleicht haben sich ja bei der Aktualisierung Probleme ergeben.geTuemII
@bastla:
Das widerpricht aber völlig dem Trend zum ONElineer in dieser abgeschiedenen Ecke des Forums.
geTuemII
Das widerpricht aber völlig dem Trend zum ONElineer in dieser abgeschiedenen Ecke des Forums.
geTuemII
@geTuemII
Willst Du wirklich sowas?
Grüße
bastla
Willst Du wirklich sowas?
Set I=WScript.CreateObject("Scripting.FileSystemObject").OpenTextFile("D:\Test.txt",1):Set O=WScript.CreateObject("Scripting.FileSystemObject").OpenTextFile("D:\TestMitC.txt",2,True):Do While Not I.AtEndOfStream:O.WriteLine ",,,,,,,,,"&I.ReadLine&",,,,,,,,,":Loop:I.Close:O.Close
Grüße
bastla
@thekingofqueens
Wenn Du sicher bist, dass Du keine Leerstellen brauchst, versuch es damit:
Grüße
bastla
Wenn Du sicher bist, dass Du keine Leerstellen brauchst, versuch es damit:
Const sInFile = "D:\Test.txt"
Const sOutFile = "D:\TestMitC.txt"
Const cVor = ","
Const iVor = 9
Const cNach = ","
Const iNach = 9
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
Set oInFile = fso.OpenTextFile(sInFile, 1)
Set oOutFile = fso.OpenTextFile(sOutFile, 2, True)
Do While Not oInFile.AtEndOfStream
sZeile = oInFile.ReadLine
oOutFile.WriteLine String(iVor, cVor) & Trim(sZeile) & String(iNach, cNach)
Loop
oInFile.Close
oOutFile.Close
Grüße
bastla